1 7 8 package test.compliance.server.support; 9 10 import javax.management.Notification; 11 import javax.management.NotificationListener; 12 import javax.management.ObjectName; 13 14 19 public class Listener 20 implements ListenerMBean, NotificationListener 21 { 22 public int notificationCount = 0; 23 24 public boolean error = false; 25 26 public void doSomething() 27 { 28 } 29 30 public void handleNotification(Notification notification, Object handback) 31 { 32 if (!(handback instanceof String)) 33 error = true; 34 if (!(handback.equals("MyHandback"))) 35 error = true; 36 if (!(notification.getSource() instanceof ObjectName)) 37 error = true; 38 if (!(notification.getSource().toString().equals("JMImplementation:type=MBeanServerDelegate"))) 39 error = true; 40 41 notificationCount++; 42 } 43 } 44 | Popular Tags |