commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <Joerg.Schai...@Elsag-Solutions.com>
Subject RE: [configuration] Mutability of CompositeConfiguration
Date Thu, 16 Sep 2004 06:50:27 GMT
Oliver Heger wrote on Thursday, September 16, 2004 7:50 AM:

> You can try the following:
> 
> Create a new PropertiesConfiguration object and copy the system
> properties in this object. Then add this configuration to the
> composite configuration.

And you don't have to do this manually:

final CompositeConfiguration config = new CompositeConfiguration();
config.addConfiguration(ConfigurationConverter.getConfiguration(System.getProperties()));

> After that load your configuration file using
> ConfigurationFactory and
> add the resulting Configuration to the composite
> configuration. Then the
> system properties should override the properties from file.
> 
> The reason for this behavior is that CompositeConfiguration
> operates on
> the Configuration objects it contains rather than on single
> properties. 

- Jörg

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


Mime
View raw message