1 22 package org.jboss.management.mejb; 23 24 import javax.management.JMException ; 25 import javax.management.Notification ; 26 import javax.management.NotificationFilter ; 27 import javax.management.NotificationListener ; 28 import javax.management.ObjectName ; 29 import java.rmi.Remote ; 30 import java.rmi.RemoteException ; 31 import java.rmi.server.UnicastRemoteObject ; 32 33 40 public class RMIClientNotificationListener 41 extends ClientNotificationListener 42 implements RMIClientNotificationListenerInterface 43 { 44 45 public RMIClientNotificationListener(ObjectName pSender, 46 NotificationListener pClientListener, 47 Object pHandback, 48 NotificationFilter pFilter, 49 MEJB pConnector) 50 throws RemoteException , 51 JMException 52 { 53 super(pSender, pClientListener, pHandback); 54 Remote lStub = UnicastRemoteObject.exportObject(this); 56 createListener(pConnector, 58 "org.jboss.management.mejb.RMINotificationListener", 59 new Object []{lStub}, 60 new String []{RMIClientNotificationListenerInterface.class.getName()}); 61 addNotificationListener(pConnector, pFilter); 62 } 63 64 71 public void handleNotification(Notification pNotification, 72 Object pHandback) 73 throws RemoteException 74 { 75 try 76 { 77 mClientListener.handleNotification(pNotification, 78 mHandback); 79 } 80 catch (RuntimeException re) 81 { 82 throw new RemoteException ("Exceptions returned by the client listener", re); 83 } 84 catch (Error e) 85 { 86 throw new RemoteException ("Error returned by the client listener", e); 87 } 88 } 89 } 90 | Popular Tags |