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] read only configuration with combined configurations
Date Tue, 12 Apr 2016 19:28:43 GMT
Hi Mansour,

Am 12.04.2016 um 05:39 schrieb Mansour Al Akeel:
> Hello,
> 
> I am looking to create a configuration repository, with multiple part,
> some for read-only, other for read. I found combined configuration
> suitable for my other requirements, but I was not able to add this mix
> of read-only and read/write configurations.

I am not sure how exactly your configuration repository looks like and
which API it provides.

I would recommend the following approach: Use a CombinedConfiguration to
manage all your configuration settings. This configuration should be
treated as immutable, e.g. convert it using
ConfigurationUtils.unmodifiableConfiguration() when exposing it to
clients. Although CombinedConfiguration has methods for updating
properties, these capabilities are limited (see [1]).

Your repository component should offer means for querying or updating
the configurations that can be modified. When adding configurations to
the combined configuration you can specify names under which these child
configurations can be accessed; you can use this mechanism to obtain
references to specific child configurations that can then be updated.
When a child configuration is manipulated, the combined configuration is
automatically updated accordingly.

Would this work for you?

Oliver

[1]
http://commons.apache.org/proper/commons-configuration/userguide/howto_combinedconfiguration.html#Dealing_with_changes

> 
> Any hint ?
> 
> Thank you.
> 
> ---------------------------------------------------------------------
> 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