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 class


  |     public 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

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4146064#4146064

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4146064
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to