-
1. Re: System Properties
adrian.brock Mar 7, 2002 12:31 PM (in response to posterboy)It is considered a bad idea to use System properties.
That is why jboss.properties has been deprecated.
It's a bit like global variables in programs ;-)
If they are part of the application, they should be
env entries in ejb-jar.xml
If they are for external services, the external service
should be accessed through jndi and the configuration
exposed for management using jmx where they can be
dynamically configured.
If you really need to use properties, add them to
run.bat/run.sh like the xml parser properties.
But this should be the exception rather than the rule.
Regards,
Adrian -
2. Re: System Properties
waggj Sep 27, 2002 10:33 AM (in response to posterboy)It maybe a bit late to re-open this question but I don't think I agree with warjort's response. I think there are valid reasons for having global variables available to an application. I agree it should be the exception rather than the rule but it is a valid thing to do. We are involved here in application production for multiple sites. There are things the application needs to know about the site it is installed on (log locations, logging levels and local configuration of the application in our case) it would be possible to include this in ejb-jar.xml's but we don't really want to produce jar's/ear's that are specific to one site. System properties are the way to do it. I suppose it's only a matter of emphasis.
-
3. Re: System Properties
waggj Sep 27, 2002 10:34 AM (in response to posterboy)It maybe a bit late to re-open this question but I don't think I agree with warjort's response. I think there are valid reasons for having global variables available to an application. I agree it should be the exception rather than the rule but it is a valid thing to do. We are involved here in application production for multiple sites. There are things the application needs to know about the site it is installed on (log locations, logging levels and local configuration of the application in our case) it would be possible to include this in ejb-jar.xml's but we don't really want to produce jar's/ear's that are specific to one site. System properties are the way to do it. I suppose it's only a matter of emphasis.
-
4. Re: System Properties
chriskrn1 Sep 27, 2002 12:51 PM (in response to posterboy)Hi Adrian
I was going to use system properties to solve my problem, but thought maybe I should get ideas from you. I have a class that needs to establish whether it is running in a web container (Tomcat) or in a J2EE app server (JBOSS). I know that web containers support init() methods in servlets, but I don't know if there is a J2EE standard way of doing this from an app server?
Any thoughts?
Regards
Chris