[
https://issues.apache.org/jira/browse/CONFIGURATION-523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13559105#comment-13559105
]
Oliver Heger commented on CONFIGURATION-523:
--------------------------------------------
Hm, it seems that the support for reloading the definition file of a
{{DefaultConfigurationBuilder}} is quite limited. The problem is that a reload
check is only performed when a property of a configuration is accessed. But
this is typically not the case for a {{DefaultConfigurationBuilder}} after it
has created its result configuration.
A workaround may be to query a synthetic property on the builder to manually
trigger a reload check. But then you also have to find out whether a reload
actually happened and - if so - query the builder for a new configuration.
That said, there is currently work going on for a version 2.0 of Configuration,
and one area which is to be improved is reloading support (see also
CONFIGURATION-520). There is already some code in SVN which allows for
periodic, timer-based reload checks. It will also work for a
{{CombinedConfigurationBuilder}} (which is the replacement for
{{DefaultConfigurationBuilder}} in 2.0). However, unfortunately, this is all
work in progress and still in an early stage.
> DefaultConfigurationBuilder is not reloading its base file
> ----------------------------------------------------------
>
> Key: CONFIGURATION-523
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-523
> Project: Commons Configuration
> Issue Type: Bug
> Components: File reloading
> Affects Versions: 1.9
> Environment: Windows / Eclipse
> Reporter: Jean-Marc
> Priority: Critical
> Labels: DefaultConfigurationBuilder, reloading
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> Create a DefaultConfigurationBuilder with this example file master-config.xml
> :
> <?xml version="1.0" encoding="UTF-8" ?>
> <configuration>
> <header>
> <result forceReloadCheck="true"/>
> </header>
> <system/>
> <override>
> <properties fileName="webapp-commons.properties"
> throwExceptionOnMissing="true">
> <reloadingStrategy refreshDelay="1000"
> config-class="org.apache.commons.configuration.reloading.FileChangedReloadingStrategy"/>
>
> </properties>
> </override>
> </configuration>
> A modification to "webapp-commons.properties" is well detected and the file
> is reloaded.
> But if you modify the master-config.xml itself, nothing is reloaded, no event
> are thrown.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira