Look in the properties-service.xml file in your deploy dir
<mbean code="org.jboss.varia.property.SystemPropertiesService" name="jboss:type=Service,name=SystemProperties">
You can then tell it to watch your properties file and it will watch for updates. I dont think it will change the file however from changing
properties in the code.
I searched the docs and can't find out how to tell the mbean to monitor the files for chanages.
Is there documentation on this?
or can you tell me how to do that too?
I appreciate the help.
I stand corrected. I thought by telling the SystemProperties MBean
what property files to load that it would also load changes. That was
my main reason for using it.
However, if you look in the JBoss source file:
There is an inner class called :
/** * A timer task to check when a URL changes (based on * last modified time) and reconfigure Log4j. */ private class URLWatchTimerTask
This class watches the log4j.xml file in the conf dir and reloads it when
ever it changes.
Using something similar you could write your own property handler or
you could create a hack that would touch the properties-service.xml
file because it uses the URLDeploymentScanner to see when it is modified
and then re-reads the property files pointed to.
Unless anyone else has a better suggestion I'll be doing something similar
since that was a feature I was hoping for.
I know that through the console you can tell it to load a properties file - via the Load() method through the console.
What I did is change the file, then put the URL/Name into the parameter for the mbean and it loaded the file right then.
So you can have it reread a properties file by entering it just like it is in the xml file into the load() method.
I would prefer a monitor like you mentioned - not sure if I'll have time to do it right now though so I may use this manual way for now.