1 22 package org.jboss.test.jmx.compliance.server.support; 23 24 import javax.management.Notification ; 25 import javax.management.NotificationListener ; 26 import javax.management.ObjectName ; 27 28 33 public class Listener 34 implements ListenerMBean, NotificationListener 35 { 36 public int notificationCount = 0; 37 38 public boolean error = false; 39 40 public void doSomething() 41 { 42 } 43 44 public void handleNotification(Notification notification, Object handback) 45 { 46 if (!(handback instanceof String )) 47 error = true; 48 if (!(handback.equals("MyHandback"))) 49 error = true; 50 if (!(notification.getSource() instanceof ObjectName )) 51 error = true; 52 if (!(notification.getSource().toString().equals("JMImplementation:type=MBeanServerDelegate"))) 53 error = true; 54 55 notificationCount++; 56 } 57 } 58 | Popular Tags |