commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Galluzzo <egallu...@einnovation.com>
Subject Re: [configuration] Automatic reloading
Date Mon, 15 Dec 2003 17:28:28 GMT
Emmanuel Bourg wrote:

> I wonder if it is desirable to change the PropertiesConfiguration 
> class or extend it as a ReloadablePropertiesConfiguration class. What 
> would be the best approach ? Also the same feature could be 
> implemented for the DOM4JConfiguration class. If so we might want to 
> introduce a ReloadableConfiguration interface defining the 
> is/setAutoReload and get/setRefreshDelay methods.

Alternatively, it might be nice to introduce a FileConfiguration 
interface that just has a java.io.File getFile() method.  Both 
DOM4JConfiguration and PropertiesConfiguration would implement this.  
Then one could repackage your existing ReloadablePropertiesConfiguration 
as a ReloadableConfiguration that implements Configuration but delegates 
to another FileConfiguration and checks the file every so often.  Thus:

Configuration config = new ReloadableConfiguration(
    new DOM4JConfiguration( myXMLFile ) );

or

Configuration config = new ReloadableConfiguration(
    new PropertiesConfiguration( myPropFile ) );

This is a Decorator design reminiscent of FilteredOutputStream and 
FilteredInputStream.

    - Eric



---------------------------------------------------------------------
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