commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: [configuration] Automatic reloading
Date Fri, 12 Dec 2003 04:26:29 GMT
Quoting Emmanuel Bourg <e.bourg@cross-systems.com>:

> Greetings, I'd like to contribute a slight modification to reload 
> automatically a PropertiesConfiguration if the underlying .properties 
> file has been changed. I had to implement this to prevent restarting my 
> web application every time a configuration file is modified.
> 
> The auto reload mode is enabled by calling setAutoReload(true) on the 
> PropertiesConfiguration instance. It's disabled by default. Every time a 
> property is accessed with getXXX(key) the date of the file is checked 
> and the configuration is reloaded if the previous date known is older. 
> This check is executed only once every 5 seconds to prevent hammering 
> the file system.
> 
> I'm attaching the patch and the modified files to this mail, all test 
> cases passed successfully. I've also added a specific test case for the 
> automatic reloading scenario.
> 
> Emmanuel Bourg
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message