RE: Wrapping notification listeners?

"Bordet, Simone" <[email protected]>
Newsgroups gmane.comp.java.mx4j.devel
Message-ID <F4F4494F4618794E99E59D41C5292FFD0186804E@mnoexc01.emea.cpqcorp.net>
Hi, 

> Concerning the specific behaviour of MX4J that you mention, if MX4J 
> could supply an identical listener to removeNotificationListener to
what 
> it previously gave to addNotificationListener, that would certainly 
> improve portability, in that it would allow a NotificationBroadcaster 
> implementation that uses identity to work in the usual case.

This has been implemented.
To be precise, and double check I've understood correctly, now MX4J
passes to removeNL() the same (in the sense of identity) listener that
was passed to addNL(), *for the same (identical) emitter*.
The last part of the sentence means that if the same listener is added
to 2 different emitters, the emitters get one listener each, and those
listeners are equal but not identical.

Maybe it is possible to specify (JSR 255) these as the minimum
assumptions to make when re-implementing from scratch
NotificationEmitter:
1. Assume addNL()/removeNL() are passed the same (identical) listeners
2. Assume that the same listener for 2 emitters can only be compared via
equals().

Comments ?

Simon


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.