DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38929>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38929





------- Additional Comments From [EMAIL PROTECTED]  2006-03-13 18:14 -------
What are the functional requirements for this feature? A set of real use cases
would help us in specifying this properly.

Notifications are useful when complex objects are initialised from the
configuration and need to be destroyed and rebuilt from scratch whenever a
property changes. 

A JDBC connection pool is a good example. It could be configured with the
following set of properties in a config.properties file:

    database.driver=oracle.jdbc.driver.OracleDriver
    database.url=jdbc:oracle:thin:@127.0.0.1:1525:JAKARTA
    database.username=scott
    database.password=tiger

If one of these properties changes, the pool has to be reinitialised. Monitoring
all the properties individually is not very practical. It would lead to a code
like this:

    conf.addPropertyListener("database.driver", this);
    conf.addPropertyListener("database.url", this);
    conf.addPropertyListener("database.username", this);
    conf.addPropertyListener("database.password", this);

With the risk of receiving 4 notifications when the configuration file changes,
leading to 4 consecutive reinitialisations of the pool, this is clearly not
desirable. This shows the need to monitor a set of properties. I have 3 types of
syntax in mind for this:

    conf.addPropertyListener("database.*", this);
    
or

    conf.subset("database").addPropertyListener("*", this);
    
or

    conf.subset("database").addConfigurationListener(this);
    
(a ConfigurationListener would listen for configuration wide events like reload
and clear, a PropertyListener would listen for changes specific to a given
property, or a set of properties). This raises the issue of the notifications
for subsets or sub nodes, this may be fun to implement :)


More use cases would be helpful. It might also be worth looking at the
notification mechanisms of JMX and java.util.prefs. The Preferences API has node
level notifications. JMX has a concept of error notification similar to Jorg's
idea (MonitorNotification.OBSERVED_ATTRIBUTE_ERROR), it also tracks in the event
fired the old value and the class of the property changed.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to