ListenerRegistration (Java EE 5 SDK)

Java

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


javax.management.j2ee Interface ListenerRegistration

所有父接口:
Serializable

public interface ListenerRegistration
extends Serializable

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

作者:
Hans Hrasna

方法摘要
 void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
          Add a listener to a registered managed object.
 void removeNotificationListener(ObjectName name, NotificationListener listener)
          Remove a listener from a registered managed object.
 

方法详细信息

addNotificationListener

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

参数:
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.
抛出异常:
InstanceNotFoundException - The managed object name provided does not match any of the registered managed objects.
RemoteException - A communication exception occurred during the execution of a remote method call

removeNotificationListener

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

参数:
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.
抛出异常:
InstanceNotFoundException - The managed object name provided does not match any of the registered managed objects.
ListenerNotFoundException - The listener is not registered in the managed object.
RemoteException - A communication exception occurred during the execution of a remote method call

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


提交错误或意见

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.