-
1. Re: Property file management
andrewboyd Jan 6, 2004 5:19 PM (in response to twgerber)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.
Andrew -
2. Re: Property file management
twgerber Jan 7, 2004 9:13 AM (in response to twgerber)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.
Tom -
3. Re: Property file management
andrewboyd Jan 7, 2004 2:14 PM (in response to twgerber)Hey Tom,
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:server\src\main\org\jboss\logging\Log4jService.java
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.
Andrew -
4. Re: Property file management
twgerber Jan 7, 2004 2:20 PM (in response to twgerber)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.