ListenerRegistration (Java EE 5)

Java EE API


javax.management.j2ee Interface ListenerRegistration

All Superinterfaces:
Serializable

public interface ListenerRegistration
extends Serializable

Implements: java.io.Serializable

ListenerRegistration 定义 MEJB 的客户端用于添加和移除事件侦听器的方法。
英文文档:

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

Author:
Hans Hrasna

Method Summary
 void
 void
 

Method Detail

public void addNotificationListener(javax.management.ObjectName name, javax.management.NotificationListener listener, javax.management.NotificationFilter filter, Object handback) throws javax.management.InstanceNotFoundException, java.rmi.RemoteException
向已注册的管理对象添加侦听器。
name 管理对象的名称,将在该对象上添加侦听器。
listener 侦听器对象,它将处理已注册的管理对象所发出的通知。
filter 过滤器对象。如果 filter 为 null,则处理通知前不执行过滤。
handback 发出通知时要发送到侦听器的上下文。
Throwsjavax.management.InstanceNotFoundException: 如果提供的管理对象与任何已注册管理对象都不匹配。
Throwsjava.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档:

addNotificationListener

void addNotificationListener(ObjectName name,
                             NotificationListener listener,
                             NotificationFilter filter,
                             Object handback)
                             throws InstanceNotFoundException,
                                    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 - 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

public void removeNotificationListener(javax.management.ObjectName name, javax.management.NotificationListener listener) throws javax.management.InstanceNotFoundException, javax.management.ListenerNotFoundException, java.rmi.RemoteException
从已注册管理对象中移除一个侦听器。
name 管理对象的名称,将在该对象上移除侦听器。
listener 侦听器对象,它将处理已注册的管理对象所发出的通知。此方法将移除与此侦听器相关的所有信息。
Throwsjavax.management.InstanceNotFoundException: 如果提供的管理对象与任何已注册管理对象都不匹配。
Throwsjavax.management.ListenerNotFoundException: 如果该侦听器未在管理对象中注册。
Throwsjava.rmi.RemoteException: 执行远程方法调用期间发生通信异常
英文文档:

removeNotificationListener

void removeNotificationListener(ObjectName name,
                                NotificationListener listener)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException,
                                       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 - 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


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!