Methods Summary |
---|
public void | addListener(java.lang.String id, javax.management.NotificationListener l, java.lang.Object handback)
if (debug) System.out.println("EventListenerProxy.addListener()");
listenerTable.put(id, l);
handbackTable.put(id, handback);
|
public static com.sun.enterprise.management.agent.EventListenerProxy | getEventListenerProxy()
if(eventProxy == null) {
try {
eventProxy = new EventListenerProxy();
Naming.rebind(proxyAddress, eventProxy);
if(debug) System.out.println(rmiName + " bound to existing registry at port " + portnum );
} catch (RemoteException re) {
if(debug) System.out.println("Naming.rebind("+ proxyAddress +", eventProxy): " + re);
try {
eventProxy = new EventListenerProxy();
Registry r = LocateRegistry.createRegistry(portnum);
r.bind(rmiName, eventProxy);
if(debug) System.out.println(rmiName + " bound to newly created registry at port " + portnum );
} catch(Exception e) {
eventProxy = null;
if(debug) e.printStackTrace();
}
} catch (Exception e) {
if(debug) e.printStackTrace();
}
}
return eventProxy;
|
public java.lang.String | getProxyAddress()
return proxyAddress;
|
public void | handleNotification(javax.management.Notification n, java.lang.Object h)
if (debug) System.out.println("EventListenerProxy:handleNotification(" + n + ")");
NotificationListener listener = (NotificationListener)listenerTable.get((String)h);
if (listener != null) {
Object handback = handbackTable.get((String)h);
listener.handleNotification(n,handback);
} else {
System.out.println("EventListenerProxy: listener id " + h + " not found");
}
|
public void | removeListener(java.lang.String id)
if(listenerTable.remove(id) == null) {
throw new ListenerNotFoundException();
} else {
handbackTable.remove(id);
}
|