javax.management.j2ee
Interface ListenerRegistration

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
ListenerRegistration (src)

public interface ListenerRegistration
extends java.io.Serializable

ListenerRegistration defines the methods which clients of the MEJB use to add and remove event listeners.


Method Summary
 void addNotificationListener(ObjectName (src)  name, NotificationListener (src)  listener, NotificationFilter (src)  filter, java.lang.Object handback)
          Add a listener to a registered managed object.
 void removeNotificationListener(ObjectName (src)  name, NotificationListener (src)  listener)
          Remove a listener from a registered managed object.
 

Method Detail

addNotificationListener

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

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:
InstanceNotFoundException (src) - The managed object name provided does not match any of the registered managed objects.
java.rmi.RemoteException - A communication exception occurred during the execution of a remote method call

removeNotificationListener

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

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:
InstanceNotFoundException (src) - The managed object name provided does not match any of the registered managed objects.
ListenerNotFoundException (src) - The listener is not registered in the managed object.
java.rmi.RemoteException - A communication exception occurred during the execution of a remote method call