| How to inject System properties into JBoss ? |
| Written by Mark S. | |||||
|
One cool way to add a list of System properties to JBoss is the Properties MBean Service. In the deployment folder look for "properties-service.xml". (if you don't have it in your release you can create it at any time) : Now add your properties either in the URLList Attribute or in the Properties Attribute:
<server>
<mbean code="org.jboss.varia.property.SystemPropertiesService"
name="jboss:type=Service,name=SystemProperties">
<attribute name="URLList">
http://somehost/some-location.properties,
./conf/somelocal.properties
</attribute>
<attribute name="Properties">
property1=This is the value of my property
property2=This is the value of my other property
</attribute>
</server>
As you can see the The "URLList" is a comma-separated list of URL strings from which to load properties file-formatted content while the "Properties" is a specification of multiple property name=value pairs Now you can access your properties with standard: System.getProperty("property1");
JBoss.org Search
Custom Search
Only registered users can write comments!
Powered by !JoomlaComment 3.26
3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved." |


