1 22 package org.jboss.test.jmx.invoker; 23 24 import java.rmi.RemoteException ; 25 import java.rmi.server.UnicastRemoteObject ; 26 import javax.management.Notification ; 27 import javax.management.NotificationListener ; 28 import org.jboss.jmx.adaptor.rmi.RMINotificationListener; 29 import org.jboss.net.sockets.TimeoutClientSocketFactory; 30 31 39 public class BadListener implements NotificationListener 40 { 41 int count; 42 43 public int getCount() 44 { 45 return count; 46 } 47 public void handleNotification(Notification event, Object handback) 48 { 49 System.out.println("BadListener handleNotification, event: "+event+", count="+count); 50 count ++; 51 try 52 { 53 System.out.println("Sleeping 30 seconds..."); 54 Thread.sleep(30*1000); 55 } 56 catch(InterruptedException e) 57 { 58 e.printStackTrace(); 59 } 60 System.out.println("Awake"); 61 } 62 } 63 | Popular Tags |