This content has been marked as final.
Show 1 reply
-
1. Re: Remote RMI JMX listner
cuthbe Apr 23, 2008 3:40 AM (in response to cuthbe)By using the following
MBeanServerConnection mbsc = (MBeanServerConnection) ctx.lookup("jmx/invoker/RMIAdaptor");
//
ObjectName serverInfo = new ObjectName("jboss.system:type=ServerInfo");
mbsc.addNotificationListener(serverInfo, this, null, null);
And then placing the following listner in my classpublic void handleNotification(Notification notification, Object handback) { System.out.println("\nReceived notification:"); System.out.println("\tClassName: " + notification.getClass().getName()); System.out.println("\tSource: " + notification.getSource()); System.out.println("\tType: " + notification.getType()); System.out.println("\tMessage: " + notification.getMessage()); if (notification instanceof AttributeChangeNotification) { AttributeChangeNotification acn = (AttributeChangeNotification) notification; System.out.println("\tAttributeName: " + acn.getAttributeName()); System.out.println("\tAttributeType: " + acn.getAttributeType()); System.out.println("\tNewValue: " + acn.getNewValue()); System.out.println("\tOldValue: " + acn.getOldValue()); } }
I don't get any events come through on the attributes, can you subscirbe to attribute changes