org.glassfish.admin.mejb
Class ListenerRegistry

java.lang.Object
  extended by org.glassfish.admin.mejb.ListenerRegistry
All Implemented Interfaces:
java.io.Serializable, ListenerRegistration

public final class ListenerRegistry
extends java.lang.Object
implements ListenerRegistration

ListenerRegistry provides an implementation of ListenerRegistration This implementation creates instances of RemoteListenerConnectors which are registered on the MEJB on behalf of the local listener. Note that this cannot possibly work for remote listeners due to MEJBUtility not supporting anything but the local MBeanServer.

Author:
Hans Hrasna
See Also:
Serialized Form

Constructor Summary
ListenerRegistry(java.lang.String ip)
           
 
Method Summary
 void addNotificationListener(javax.management.ObjectName name, javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)
          Add a listener to a registered managed object.
 void removeNotificationListener(javax.management.ObjectName name, javax.management.NotificationListener listener)
          Remove a listener from a registered managed object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListenerRegistry

public ListenerRegistry(java.lang.String ip)
Method Detail

addNotificationListener

public void addNotificationListener(javax.management.ObjectName name,
                                    javax.management.NotificationListener listener,
                                    javax.management.NotificationFilter filter,
                                    java.lang.Object handback)
                             throws java.rmi.RemoteException
Add a listener to a registered managed object.

Specified by:
addNotificationListener in interface ListenerRegistration
Parameters:
name - The name of the managed object on which the listener should be added.
listener - The listener object which will handle the notifications emitted by the registered managed object.
filter - The filter object. If filter is null, no filtering will be performed before handling notifications.
handback - The context to be sent to the listener when a notification is emitted.
Throws:
javax.management.InstanceNotFoundException - The managed object name provided does not match any of the registered managed objects.
java.rmi.RemoteException

removeNotificationListener

public void removeNotificationListener(javax.management.ObjectName name,
                                       javax.management.NotificationListener listener)
                                throws java.rmi.RemoteException
Remove a listener from a registered managed object.

Specified by:
removeNotificationListener in interface ListenerRegistration
Parameters:
name - The name of the managed object on which the listener should be removed.
listener - The listener object which will handle the notifications emitted by the registered managed object. This method will remove all the information related to this listener.
Throws:
javax.management.InstanceNotFoundException - The managed object name provided does not match any of the registered managed objects.
javax.management.ListenerNotFoundException - The listener is not registered in the managed object.
java.rmi.RemoteException


Copyright © 2012 GlassFish Community. All Rights Reserved.