-
1. Re: Sending notifications from MBean to client
dimitris Dec 2, 2004 5:29 AM (in response to mmigal)I haven't touched the RMIAdaptor for some time, but doesn't RMIAdaptor have an addNotificationListener() and removeNotificationListener on its interface?
If that works as expected you'd just have to call the above methods and implement the following interface:public interface RMINotificationListener extends Remote { public void handleNotification(Notification notification, Object handback) throws RemoteException; }
So that's more or less a remote version of the javax.management.NotificationListener interface -
2. Re: Sending notifications from MBean to client
starksm64 Dec 2, 2004 11:35 AM (in response to mmigal)There are examples of this in the testsuite as well as the admin/devel guide.
-
3. Re: Sending notifications from MBean to client
mmigal Dec 2, 2004 12:18 PM (in response to mmigal)In the 3.2.6 version, in order to receive JMX notifications, docs/examples/jmx/jmx-rmi-adaptor.sar file needed to be copied to the deploy directory, and jmx-invoker-adaptor-server.sar removed. Is it still necessary in the 4.0.0 version? I don't see the jmx-rmi-adaptor.sar in the 4.0.0 docs/examples/jmx directory.
-
4. Re: Sending notifications from MBean to client
starksm64 Dec 2, 2004 12:21 PM (in response to mmigal)No.
-
5. Re: Sending notifications from MBean to client
mmigal Dec 2, 2004 1:58 PM (in response to mmigal)Thank you for quick responses.
I have another question though. If there are multiple clients that want to listen for notifications, does the ServiceMBeanSupport class handles this case? Should I pass a unique handback object when registering, so that the listener can be uniquely identified?
Michael -
6. Re: Sending notifications from MBean to client
dimitris Dec 2, 2004 2:15 PM (in response to mmigal)Yes, you can have multiple clients without confusion.
The handback object is more or less of use to the Listener. If it has made many registrations to different MBeans it could use the handback as an id to quickly distinguish from which subscription a notification came when handleNotification() is called.