Thank you, Oliver, this is a good starting point. Some points, which come in my mind:
- In addition to this registry mechanism we should also provide a generic event listener mechanism, and I think the two should be very similar, i.e. using the same listener interfaces and semantics. So it would be worth polishing the interfaces a bit. We could define a generic ConfigurationEvent class which stores the affected property, maybe its old and new values and an event type. For the listener interface we could add different callback methods, e.g. for a newly added property, for a changed property, for a removed property etc.
- Is there a specific reason why BasicConfigRegistry holds a reference to a TickProvider? I think it is only used in the constructor for registration. Maybe it is better to decouple these classes.
- It would make sense to trigger the registry not only by a TickProvider, but also support the event listener mechanism (when it is implemented). The registry would then itself be an event listener and registeres at configurations to be monitored. Then a user could choose between an event based or a timer based change notification.
- I am not quite sure, but there may be some points which might cause problems for a concrete implementation. One point is that a property can have multiple values, which can be stored as lists or arrays. This must be taken into account when detecting changes. For the implementation of a generic event listener mechanism there is the problem that many methods that have to trigger events call other methods which also trigger events. An example is the setProperty() method that is implemented by calling clearProperty() and then addProperty(). So for a set operation two events would be fired. Another example is the clear() method, which erases a configuration by calling clearProperty() on each defined property. Here we should exactly define which events we want to fire and which should be avoided.
Oliver Oliver Zeigermann wrote:
OK, I prepared a very rudimentary sketch as a basis for discussion: http://issues.apache.org/bugzilla/show_bug.cgi?id=35433 Any comments? Oliver
<snip> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
