You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by David Blevins <da...@visi.com> on 2007/02/08 05:44:31 UTC
idea: conf/system.properties
Ok, throwing out another idea. We've got a number of things that can
be configured via system properties. What do people think about
having a file called system.properties we put in the conf/ directory
where people can put any properties they want and we will read them
in and add them to System.getProperties().
This would be in addition to the ability people already have to
properties added to the system properties via -D args. E.g.
./bin/openejb start -Dfoo=bar
We'd probably want the -D args to be applied after we read in the
system.properties file so anything on the command line would win.
We have a ton of things we can do with system properties already. I
started to write them into this email but moved it into a new
confluence page as it was too big :)
http://cwiki.apache.org/OPENEJB/system-properties.html
See this related jira (OPENEJB-451)
Not to mention people may want to add their own properties for their
apps. See a related idea (OPENEJB-457)
So what do people think? Thumbs up? Thumbs down? <Insert your
thoughts here>
-David
Re: idea: conf/system.properties
Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On 2/8/07, David Blevins <da...@visi.com> wrote:
> It's something I've been tempted to add for the longest time but
> couldn't find an elegant way. I had only thought about it from an
> OpenEJB perspective and it had always seemed odd considering the conf
> file already is properties based. It wasn't till Dain asked me for
> the feature and wanted to use it for OpenJPA and CORBA that it
> occurred to me we could just go the opposite direction and call it
> system.properties and open it wide up as a general way to add any
> system property to the System.getProperties() instance, OpenEJB
> specific or not.
I don't mean to repeat others' responses, but I like the idea, too. It
could be layered so there could be more than one system property
provider. You could extend it even futher where your properties be
values retrieved from a database (well, in this case you'd need to set
up the connection first, but that's another story).
All in all, I like it and it should be easy to implement. Just read
the file (whatever the format could be in) and populate a
SystemInstance instance. If the file doesn't exist, do nothing.
I think it's a great time for lurkers to show up and develop it. We
could indeed discuss other possibilities, but the very bare
implementation would just read the file and hand it over to
SystemInstance. As Dave pointed out, these properties had the lowest
priority and would be overriden by other properties, but a developer
doesn't have to think about it as long as the implementation is hooked
as one of the very first initialization calls in OpenEJB.
I like it! No need for jvm properties anymore (the solution would
mimic the jvm properties handling).
It's said that "great ideas are born in great minds". Shall we propose
a change to the proverb so it'll better reflect who it talks about?
;-)
Jacek
--
Jacek Laskowski
http://www.JacekLaskowski.pl
Re: idea: conf/system.properties
Posted by David Blevins <da...@visi.com>.
On Feb 7, 2007, at 10:14 PM, Manu George wrote:
> Very Cool . Will be very useful. Will not need to specify a lot of
> commandline properties
Yea I think it will be very neat. For the most part the openejb.conf
file format we've been using since back in 0.8.x is entirely
properties based -- it was modeled after the httpd.conf file (they
get credit for the idea :). But you can do more with the system
properties than you can in the openejb.conf, especially when you
throw in all the other libraries that have system properties to be
configured.
It's something I've been tempted to add for the longest time but
couldn't find an elegant way. I had only thought about it from an
OpenEJB perspective and it had always seemed odd considering the conf
file already is properties based. It wasn't till Dain asked me for
the feature and wanted to use it for OpenJPA and CORBA that it
occurred to me we could just go the opposite direction and call it
system.properties and open it wide up as a general way to add any
system property to the System.getProperties() instance, OpenEJB
specific or not.
-David
> Regards
> Manu
>
> On 2/8/07, Dain Sundstrom <da...@iq80.com> wrote:
>> Very cool. It will give us a good place to put common system
>> properties like keystores and keystore passowords, not to mention the
>> billion properties CORBA needs.
>>
>> -dain
>>
>> On Feb 7, 2007, at 8:44 PM, David Blevins wrote:
>>
>> > Ok, throwing out another idea. We've got a number of things that
>> > can be configured via system properties. What do people think
>> > about having a file called system.properties we put in the conf/
>> > directory where people can put any properties they want and we will
>> > read them in and add them to System.getProperties().
>> >
>> > This would be in addition to the ability people already have to
>> > properties added to the system properties via -D args. E.g.
>> >
>> > ./bin/openejb start -Dfoo=bar
>> >
>> > We'd probably want the -D args to be applied after we read in the
>> > system.properties file so anything on the command line would win.
>> >
>> > We have a ton of things we can do with system properties already.
>> > I started to write them into this email but moved it into a new
>> > confluence page as it was too big :)
>> >
>> > http://cwiki.apache.org/OPENEJB/system-properties.html
>> >
>> > See this related jira (OPENEJB-451)
>> >
>> > Not to mention people may want to add their own properties for
>> > their apps. See a related idea (OPENEJB-457)
>> >
>> > So what do people think? Thumbs up? Thumbs down? <Insert your
>> > thoughts here>
>> >
>> > -David
>> >
>> >
>> >
>>
>>
>
Re: idea: conf/system.properties
Posted by Manu George <ma...@gmail.com>.
Very Cool . Will be very useful. Will not need to specify a lot of
commandline properties
Regards
Manu
On 2/8/07, Dain Sundstrom <da...@iq80.com> wrote:
> Very cool. It will give us a good place to put common system
> properties like keystores and keystore passowords, not to mention the
> billion properties CORBA needs.
>
> -dain
>
> On Feb 7, 2007, at 8:44 PM, David Blevins wrote:
>
> > Ok, throwing out another idea. We've got a number of things that
> > can be configured via system properties. What do people think
> > about having a file called system.properties we put in the conf/
> > directory where people can put any properties they want and we will
> > read them in and add them to System.getProperties().
> >
> > This would be in addition to the ability people already have to
> > properties added to the system properties via -D args. E.g.
> >
> > ./bin/openejb start -Dfoo=bar
> >
> > We'd probably want the -D args to be applied after we read in the
> > system.properties file so anything on the command line would win.
> >
> > We have a ton of things we can do with system properties already.
> > I started to write them into this email but moved it into a new
> > confluence page as it was too big :)
> >
> > http://cwiki.apache.org/OPENEJB/system-properties.html
> >
> > See this related jira (OPENEJB-451)
> >
> > Not to mention people may want to add their own properties for
> > their apps. See a related idea (OPENEJB-457)
> >
> > So what do people think? Thumbs up? Thumbs down? <Insert your
> > thoughts here>
> >
> > -David
> >
> >
> >
>
>
Re: idea: conf/system.properties
Posted by Dain Sundstrom <da...@iq80.com>.
Very cool. It will give us a good place to put common system
properties like keystores and keystore passowords, not to mention the
billion properties CORBA needs.
-dain
On Feb 7, 2007, at 8:44 PM, David Blevins wrote:
> Ok, throwing out another idea. We've got a number of things that
> can be configured via system properties. What do people think
> about having a file called system.properties we put in the conf/
> directory where people can put any properties they want and we will
> read them in and add them to System.getProperties().
>
> This would be in addition to the ability people already have to
> properties added to the system properties via -D args. E.g.
>
> ./bin/openejb start -Dfoo=bar
>
> We'd probably want the -D args to be applied after we read in the
> system.properties file so anything on the command line would win.
>
> We have a ton of things we can do with system properties already.
> I started to write them into this email but moved it into a new
> confluence page as it was too big :)
>
> http://cwiki.apache.org/OPENEJB/system-properties.html
>
> See this related jira (OPENEJB-451)
>
> Not to mention people may want to add their own properties for
> their apps. See a related idea (OPENEJB-457)
>
> So what do people think? Thumbs up? Thumbs down? <Insert your
> thoughts here>
>
> -David
>
>
>
Re: idea: conf/system.properties
Posted by Karan Malhi <ka...@gmail.com>.
I have noticed that during the bootstrap process of server startup , we put
system properties multiple times into SystemInstance. Maybe I overlooked
something, but there are multiple places where the SystemInstance gets
initialized with SystemInstance.init(System.getProperties()). This call is
already made in the MainImpl.main . For example, in the
org.apache.openejb.loader.Server.parseArguments() has the following:
private static Properties parseArguments(String args[]) throws
DontStartServerException {
Properties props = new Properties();
props.putAll(System.getProperties());
props.put("openejb.server.ip", "127.0.0.1");
props.put("openejb.server.port", "4201");
props.put("openejb.server.threads", "20");
.....
return props;
}
And we have the following in org.apache.openejb.loader.Server.main()
Properties props = parseArguments(args);
SystemInstance.init(props);
And we have the following in the org.apache.openejb.cli.MainImpl.main
try {
SystemInstance.init(System.getProperties());
systemInstance = SystemInstance.get();
} catch (Exception e) {
Any reason why this code is being repeated at certain places? I know i have
seen more of these, but cannot remember the rest of the occurrences. I can
certainly find them using "search" in eclipse. I think no piece of code
should call SystemInstance.init(System.getProperties()) except for
org.apache.openejb.cli.MainImpl.main. I might be wrong here, but any
clarifications would be helpful
On 2/8/07, David Blevins <da...@visi.com> wrote:
>
>
> On Feb 7, 2007, at 10:32 PM, Vamsavardhana Reddy wrote:
>
> > I didn't realize that I am responding to openejb-dev list :o( .
> > Ignore my
> > post on adding geronimo to the filename.
>
> No sweat :) No harm no foul. Substitute openejb for geronimo and
> it's still a good suggestion worth talking about.
>
> Q: "Should we add openejb to the filename and call it openejb-
> system.properties?"
>
> I thought about that and two thoughts come to mind:
>
> - The first is that we'd be adding all the properties to the
> actual System.getProperties properties instance, so it's really not
> openejb specific at all. People could use it to add any properties
> to their apps or other systems we use like OpenJPA or ActiveMQ.
> Seems just about every library we use has at least one system
> property of some kind that can be configured.
>
> - The second thought is that we *do* have an OpenEJB-specific
> properties instance that kind of conflicts with the vm's system
> property concept. There is an object SystemInstance which as a set
> of properties and that thing is more or less classloader scoped (i.e.
> there can be several of them in a vm, one for each OpenEJB
> instance). For example in our Tomcat integration you can have one
> OpenEJB container system embedded in each webapp and they'll be
> completely isolated from each other and not bump into each other at
> all (this is an alternate to the global style tomcat integration).
> In that scenario each webapp gets it's own openejb.conf file and
> could have it's own openejb.properties file too, but those properties
> couldn't be added to the System.getProperties() instance as then each
> webapp would be overwriting every other webapp's data in what is
> supposed to be an isolated environment. All the properties would be
> OpenEJB specific is they won't be in the System.getProperties()
> instance and only in the openejb-specific SystemInstance.getProperties
> () instance, so you wouldn't be able to use it to configure anything
> third-party libs as they're unlikely to check there.
>
> Other thoughts welcome as always. Better solutions are made from
> trading alternate ideas, so be brave and post your thinking if you
> sees other solutions (that's always on the table and strongly
> encouraged).
>
> And thanks, Vamsi, a very good question regardless!
>
> -David
>
> >
> > Thanks,
> > Vamsi
> >
> > On 2/8/07, David Blevins <da...@visi.com> wrote:
> >>
> >> On Feb 7, 2007, at 9:28 PM, Vamsavardhana Reddy wrote:
> >>
> >> > Should we add geronimo to the filename and call it
> >> > geronimo-system.properties?
> >>
> >> The system property override feature has been around since OpenEJB
> >> 1.x (e.g. it's not a geronimo thing).
> >>
> >> Ted Kirby posted a proposal and patch recently for similar
> >> functionality in Geronimo. Check out: http://
> >> marc.theaimsgroup.com/?
> >> t=116916235600001&r=1&w=2
> >>
> >> -David
> >>
> >> >
> >> > Vamsi
> >> >
> >> > On 2/8/07, David Blevins <da...@visi.com> wrote:
> >> >>
> >> >> Ok, throwing out another idea. We've got a number of things
> >> that can
> >> >> be configured via system properties. What do people think about
> >> >> having a file called system.properties we put in the conf/
> >> directory
> >> >> where people can put any properties they want and we will read
> >> them
> >> >> in and add them to System.getProperties().
> >> >>
> >> >> This would be in addition to the ability people already have to
> >> >> properties added to the system properties via -D args. E.g.
> >> >>
> >> >> ./bin/openejb start -Dfoo=bar
> >> >>
> >> >> We'd probably want the -D args to be applied after we read in the
> >> >> system.properties file so anything on the command line would win.
> >> >>
> >> >> We have a ton of things we can do with system properties
> >> already. I
> >> >> started to write them into this email but moved it into a new
> >> >> confluence page as it was too big :)
> >> >>
> >> >> http://cwiki.apache.org/OPENEJB/system-properties.html
> >> >>
> >> >> See this related jira (OPENEJB-451)
> >> >>
> >> >> Not to mention people may want to add their own properties for
> >> their
> >> >> apps. See a related idea (OPENEJB-457)
> >> >>
> >> >> So what do people think? Thumbs up? Thumbs down? <Insert your
> >> >> thoughts here>
> >> >>
> >> >> -David
> >> >>
> >> >>
> >> >>
> >> >>
> >>
> >>
>
>
--
Karan Malhi
Re: idea: conf/system.properties
Posted by David Blevins <da...@visi.com>.
On Feb 7, 2007, at 10:32 PM, Vamsavardhana Reddy wrote:
> I didn't realize that I am responding to openejb-dev list :o( .
> Ignore my
> post on adding geronimo to the filename.
No sweat :) No harm no foul. Substitute openejb for geronimo and
it's still a good suggestion worth talking about.
Q: "Should we add openejb to the filename and call it openejb-
system.properties?"
I thought about that and two thoughts come to mind:
- The first is that we'd be adding all the properties to the
actual System.getProperties properties instance, so it's really not
openejb specific at all. People could use it to add any properties
to their apps or other systems we use like OpenJPA or ActiveMQ.
Seems just about every library we use has at least one system
property of some kind that can be configured.
- The second thought is that we *do* have an OpenEJB-specific
properties instance that kind of conflicts with the vm's system
property concept. There is an object SystemInstance which as a set
of properties and that thing is more or less classloader scoped (i.e.
there can be several of them in a vm, one for each OpenEJB
instance). For example in our Tomcat integration you can have one
OpenEJB container system embedded in each webapp and they'll be
completely isolated from each other and not bump into each other at
all (this is an alternate to the global style tomcat integration).
In that scenario each webapp gets it's own openejb.conf file and
could have it's own openejb.properties file too, but those properties
couldn't be added to the System.getProperties() instance as then each
webapp would be overwriting every other webapp's data in what is
supposed to be an isolated environment. All the properties would be
OpenEJB specific is they won't be in the System.getProperties()
instance and only in the openejb-specific SystemInstance.getProperties
() instance, so you wouldn't be able to use it to configure anything
third-party libs as they're unlikely to check there.
Other thoughts welcome as always. Better solutions are made from
trading alternate ideas, so be brave and post your thinking if you
sees other solutions (that's always on the table and strongly
encouraged).
And thanks, Vamsi, a very good question regardless!
-David
>
> Thanks,
> Vamsi
>
> On 2/8/07, David Blevins <da...@visi.com> wrote:
>>
>> On Feb 7, 2007, at 9:28 PM, Vamsavardhana Reddy wrote:
>>
>> > Should we add geronimo to the filename and call it
>> > geronimo-system.properties?
>>
>> The system property override feature has been around since OpenEJB
>> 1.x (e.g. it's not a geronimo thing).
>>
>> Ted Kirby posted a proposal and patch recently for similar
>> functionality in Geronimo. Check out: http://
>> marc.theaimsgroup.com/?
>> t=116916235600001&r=1&w=2
>>
>> -David
>>
>> >
>> > Vamsi
>> >
>> > On 2/8/07, David Blevins <da...@visi.com> wrote:
>> >>
>> >> Ok, throwing out another idea. We've got a number of things
>> that can
>> >> be configured via system properties. What do people think about
>> >> having a file called system.properties we put in the conf/
>> directory
>> >> where people can put any properties they want and we will read
>> them
>> >> in and add them to System.getProperties().
>> >>
>> >> This would be in addition to the ability people already have to
>> >> properties added to the system properties via -D args. E.g.
>> >>
>> >> ./bin/openejb start -Dfoo=bar
>> >>
>> >> We'd probably want the -D args to be applied after we read in the
>> >> system.properties file so anything on the command line would win.
>> >>
>> >> We have a ton of things we can do with system properties
>> already. I
>> >> started to write them into this email but moved it into a new
>> >> confluence page as it was too big :)
>> >>
>> >> http://cwiki.apache.org/OPENEJB/system-properties.html
>> >>
>> >> See this related jira (OPENEJB-451)
>> >>
>> >> Not to mention people may want to add their own properties for
>> their
>> >> apps. See a related idea (OPENEJB-457)
>> >>
>> >> So what do people think? Thumbs up? Thumbs down? <Insert your
>> >> thoughts here>
>> >>
>> >> -David
>> >>
>> >>
>> >>
>> >>
>>
>>
Re: idea: conf/system.properties
Posted by Vamsavardhana Reddy <c1...@gmail.com>.
I didn't realize that I am responding to openejb-dev list :o( . Ignore my
post on adding geronimo to the filename.
Thanks,
Vamsi
On 2/8/07, David Blevins <da...@visi.com> wrote:
>
> On Feb 7, 2007, at 9:28 PM, Vamsavardhana Reddy wrote:
>
> > Should we add geronimo to the filename and call it
> > geronimo-system.properties?
>
> The system property override feature has been around since OpenEJB
> 1.x (e.g. it's not a geronimo thing).
>
> Ted Kirby posted a proposal and patch recently for similar
> functionality in Geronimo. Check out: http://marc.theaimsgroup.com/?
> t=116916235600001&r=1&w=2
>
> -David
>
> >
> > Vamsi
> >
> > On 2/8/07, David Blevins <da...@visi.com> wrote:
> >>
> >> Ok, throwing out another idea. We've got a number of things that can
> >> be configured via system properties. What do people think about
> >> having a file called system.properties we put in the conf/ directory
> >> where people can put any properties they want and we will read them
> >> in and add them to System.getProperties().
> >>
> >> This would be in addition to the ability people already have to
> >> properties added to the system properties via -D args. E.g.
> >>
> >> ./bin/openejb start -Dfoo=bar
> >>
> >> We'd probably want the -D args to be applied after we read in the
> >> system.properties file so anything on the command line would win.
> >>
> >> We have a ton of things we can do with system properties already. I
> >> started to write them into this email but moved it into a new
> >> confluence page as it was too big :)
> >>
> >> http://cwiki.apache.org/OPENEJB/system-properties.html
> >>
> >> See this related jira (OPENEJB-451)
> >>
> >> Not to mention people may want to add their own properties for their
> >> apps. See a related idea (OPENEJB-457)
> >>
> >> So what do people think? Thumbs up? Thumbs down? <Insert your
> >> thoughts here>
> >>
> >> -David
> >>
> >>
> >>
> >>
>
>
Re: idea: conf/system.properties
Posted by David Blevins <da...@visi.com>.
On Feb 7, 2007, at 9:28 PM, Vamsavardhana Reddy wrote:
> Should we add geronimo to the filename and call it
> geronimo-system.properties?
The system property override feature has been around since OpenEJB
1.x (e.g. it's not a geronimo thing).
Ted Kirby posted a proposal and patch recently for similar
functionality in Geronimo. Check out: http://marc.theaimsgroup.com/?
t=116916235600001&r=1&w=2
-David
>
> Vamsi
>
> On 2/8/07, David Blevins <da...@visi.com> wrote:
>>
>> Ok, throwing out another idea. We've got a number of things that can
>> be configured via system properties. What do people think about
>> having a file called system.properties we put in the conf/ directory
>> where people can put any properties they want and we will read them
>> in and add them to System.getProperties().
>>
>> This would be in addition to the ability people already have to
>> properties added to the system properties via -D args. E.g.
>>
>> ./bin/openejb start -Dfoo=bar
>>
>> We'd probably want the -D args to be applied after we read in the
>> system.properties file so anything on the command line would win.
>>
>> We have a ton of things we can do with system properties already. I
>> started to write them into this email but moved it into a new
>> confluence page as it was too big :)
>>
>> http://cwiki.apache.org/OPENEJB/system-properties.html
>>
>> See this related jira (OPENEJB-451)
>>
>> Not to mention people may want to add their own properties for their
>> apps. See a related idea (OPENEJB-457)
>>
>> So what do people think? Thumbs up? Thumbs down? <Insert your
>> thoughts here>
>>
>> -David
>>
>>
>>
>>
Re: idea: conf/system.properties
Posted by Vamsavardhana Reddy <c1...@gmail.com>.
Should we add geronimo to the filename and call it
geronimo-system.properties?
Vamsi
On 2/8/07, David Blevins <da...@visi.com> wrote:
>
> Ok, throwing out another idea. We've got a number of things that can
> be configured via system properties. What do people think about
> having a file called system.properties we put in the conf/ directory
> where people can put any properties they want and we will read them
> in and add them to System.getProperties().
>
> This would be in addition to the ability people already have to
> properties added to the system properties via -D args. E.g.
>
> ./bin/openejb start -Dfoo=bar
>
> We'd probably want the -D args to be applied after we read in the
> system.properties file so anything on the command line would win.
>
> We have a ton of things we can do with system properties already. I
> started to write them into this email but moved it into a new
> confluence page as it was too big :)
>
> http://cwiki.apache.org/OPENEJB/system-properties.html
>
> See this related jira (OPENEJB-451)
>
> Not to mention people may want to add their own properties for their
> apps. See a related idea (OPENEJB-457)
>
> So what do people think? Thumbs up? Thumbs down? <Insert your
> thoughts here>
>
> -David
>
>
>
>