[ mx4j-Bugs-830782 ] Wrong listeners for removeNotificationListener

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.java.mx4j.devel
Message-ID <[email protected]>
Bugs item #830782, was opened at 2003-10-27 00:06
Message generated for change (Comment added) made by btscully
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=450647&aid=830782&group_id=47745

Category: RMI Adaptor/Connector
Group: Release 1.1.1
Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Brian Scully (btscully)
Summary: Wrong listeners for removeNotificationListener

Initial Comment:
An MBean implements NotificationBroadcaster.  When 
used via JRMP the listener provided in the 
removeNotificationListener() call (to the MBean) is not 
the same listener as was provided when 
addNotificationListener was called.

This means it is never possible to remove listeners ....



----------------------------------------------------------------------

>Comment By: Brian Scully (btscully)
Date: 2003-11-02 10:37

Message:
Logged In: YES 
user_id=234750

Fix applied to cvs HEAD.

----------------------------------------------------------------------

Comment By: Brian Scully (btscully)
Date: 2003-11-02 10:31

Message:
Logged In: YES 
user_id=234750

Fix applied to cvs HEAD.

----------------------------------------------------------------------

Comment By: Brian Scully (btscully)
Date: 2003-11-01 13:01

Message:
Logged In: YES 
user_id=234750

The problem is that connector.getMBeanServerConnection() 
returns a new connection every time it is called.  Until a fix is 
made, my suggested workaround is to cache the single call of 
connector.getMBeanServerConnection() and reuse that 
reference.  This allows notification listeners to be removed.  
e.g.:

MBeanServerConnection mbsc = 
connector.getMBeanServerConnection();

mbsc.addNotificationListener(bcName,l,f,null);
bc.fireEvent("Test");
		
mbsc.removeNotificationListener(bcName,l);
// No exception thrown

----------------------------------------------------------------------

Comment By: Brian Scully (btscully)
Date: 2003-11-01 12:22

Message:
Logged In: YES 
user_id=234750

I have duplicated this bug in JDK 1.4.2 (presume can be 
duplicated in JDK 1.3.1) - test case attached.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=450647&aid=830782&group_id=47745


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
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.