commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Meyer" <stat...@gmx.de>
Subject [Configuration] CombinedConfiguration reloading issue in conjunction with SubnodeConfiguration
Date Fri, 06 Mar 2009 09:05:33 GMT
Hey *,

I'm currently having an issue with the CombinedConfiguration. I would be
very grateful if someone could have a look at the problem. I'm not sure if
this is a bug, if I miss something or if I'm just trying to use the
CombinedConfiguration in way it isn't design for. Here's what I'm trying to
do:

/**********************************************************/
CombinedConfiguration config = new CombinedConfiguration();
config.setForceReloadCheck(true);
config.setNodeCombiner(new OverrideCombiner());
XMLConfiguration c = new XMLConfiguration(xmlFile);
c.setReloadingStrategy(new FileChangedReloadingStrategy());
SubnodeConfiguration sub = c.configurationAt("foo", true);
config.addConfiguration(sub);

config.getInt("bar"); /* this works fine */
// now touch the underlying xml configuration file and wait at least 5
seconds

config.getInt("bar"); /* this isn't working anymore - a
java.util.NoSuchElementException is thrown !*/
/**********************************************************/

The format of the configuration xml file I use is the following:
'<config><foo><bar>0</bar></for></config>'.

You can also have a look at the attached JUnit testcase.

Any hint would be very appreciated.

Thanks
Paul

 


Mime
View raw message