commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jamie Guillemette" <JMGuilleme...@hotmail.com>
Subject [Configuration] Save(), found bugs / preposed changes and new features
Date Thu, 07 Apr 2005 17:01:51 GMT
[Configuration] CompositeConfiguration - setting FileChangedReloadingStrategy on each XMLConfigurationHey
everyone,

I downloaded the commons configuration project a few days ago in hopes of using it to create
a generic configuration interface. 

In order to achieve this, I need an api that can a) read configuration information from multiple
datasources b) save changes back to the original datasources. (which sounds exaclty what the
configuration project is all about)

In experimenting with the api I've come across serval serveral inconsitencies with the save()
feature... (ive had no problem with simply reading values)

a) if your project is devided into src / bin and the root of the running path is neither of
these.. save a properties file will result in a new file being created in the root or the
current running path.. not overiding the existing file.

b) if you use URL to load your configuration ie 
    URL url2 = this.getClass().getResource("/sample.properties");
      config.addConfiguration(new PropertiesConfiguration(url2));
when saving...two things happen. 1) the file is not saved. 2) the in memmory representation
of the values all become null. (where previous to the save you could retreive the values without
issue)

Its seems like there is a major bug in the save() logic ... worst yet.. whatever problem that
is being encountered is not throwing a configuration exception.
If everyone agrees.. i would like to take a serious look at the existing save logic for each
configuration type add the following:

i) make any adjustments necessary to guarrentee that where the configuration data is read
from is where it is saved to reguardless of project layout.
ii) add save() to CompositeConfiguration that will delegate down to all configurations under
its control.

Let me know your thoughts guys.
J.



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message