1 7 package test.compliance.core.notification; 8 9 import javax.management.Notification ; 10 import javax.management.NotificationListener ; 11 12 15 public class BadListener implements NotificationListener 16 { 17 int count; 18 19 public int getCount() 20 { 21 return count; 22 } 23 24 public void handleNotification(Notification event, Object handback) 25 { 26 System.out.println("BadListener handleNotification, event: " + event + ", count=" + count); 27 count++; 28 try 29 { 30 System.out.println("Sleeping 30 seconds..."); 31 Thread.sleep(30 * 1000); 32 } 33 catch(InterruptedException e) 34 { 35 e.printStackTrace(); 36 } 37 System.out.println("Awake"); 38 } 39 } 40 | Popular Tags |