commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <oliver.he...@oliver-heger.de>
Subject Re: [CONFIGURATION] FileChangedReloadingStrategy inside combined configuration
Date Wed, 15 Oct 2008 19:52:50 GMT
Pavel Savara schrieb:
> Hi, 
> I have properties configuration file with FileChangedReloadingStrategy
> inside combined configuration. It doesn't seem to reload automaticaly
> when file changes. I have to go and call reload() on that configuration
> in code (((PropertiesConfiguration) conf).reload();) after that change
> is propagated fine. But as i said it not happening automatically just by
> reading properties from that file.
> 
> Thanks for help
> Pavel

CombinedConfiguration has the setForceReloadCheck() method. If called 
with *true* as argument, the configuration will trigger the reloading 
strategies of its children on each property access.

This should solve your problem.

Oliver

> 
> Combined configuration file:
> <configuration> 
>   <override>
>     <!-- Load the system properties -->
>     <system/>
>     
>     <!-- Load gsxweb properties-->
>     <properties fileName="gsxweb.properties"
> throwExceptionOnMissing="false"
>       config-name="gsxweb" config-optional="false" listDelimiter="|">
>       <reloadingStrategy refreshDelay="1"
> config-class="org.apache.commons.configuration.reloading.FileChangedReloadingStrategy"/>
>     </properties>
>     
>   </override> 
> </configuration>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 


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


Mime
View raw message