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] Sample usage of config change events
Date Fri, 25 May 2007 17:55:13 GMT
uma_rk@comcast.net wrote:
> Yes this is what I need - with the caveat that 
> when the config is reloaded,  the in-memory 
> FileConfiguration may itself be "dirty" - meaning that
> the reload should merge the changes to the
> file with the changes in the in-memory FileConfiguration.
> 
> Does it work this way?
> 
> Thanks,
> 
> /U

No, the reload does not perform a merge. It just clears the 
configuration and loads it again from disk. So all the changes performed 
before will get lost.

I don't know an easy solution for this problem. You will probably have 
to do the merging yourself. You could register a listener at the 
configuration object and try to track the change events. When a reload 
event occurs you have to manually apply the tracked changes again. This 
approach will be problematic however if a property has changed both on 
disk and in memory.

Oliver

> 
> 
>  -------------- Original message ----------------------
> From: Oliver Heger <oliver.heger@oliver-heger.de>
>> uma_rk@comcast.net wrote:
>>> I would like to see a simple example of PropertiesConfiguration
>>> driven by configuration change events emitted when the underlying
>>> file is changed.
>>>
>>> Could you pl point me to a simple illustration?
>>>
>>> Thanks,
>>>
>>> /U
>>>
>> I am not sure whether I understand you correctly. What exactly do you 
>> mean by "driven by configuration change events"?
>>
>> Our reloading strategies do not directly fire events when a change at 
>> the monitored file happens. The check will be performed when a property 
>> is accessed from the associated Configuration object. If the strategy 
>> then detects that the file was changed in the meantime, a reload is 
>> automatically triggered for the Configuration. This will also cause the 
>> Configuration object to fire a RELOAD event.
>>
>> Is this what you need?
>>
>> Oliver
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
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