站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Java Platform, Enterprise Edition v1.4 API Specifications

ListenerRegistration (Java 2 Platform Ent. Ed. v1.4) - Java Platform, Enterprise Edition v1.4 API Specifications

JavaTM 2 Platform
Ent. Ed. v1.4

javax.management.j2ee
Interface ListenerRegistration

All Superinterfaces:
Serializable

public interface ListenerRegistration
extends Serializable

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

Author:
Hans Hrasna

Method Summary
 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.
 

Method Detail

addNotificationListener

public 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

removeNotificationListener

public 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

JavaTM 2 Platform
Ent. Ed. v1.4

Submit a bug or feature

Copyright 2003 Sun Microsystems, Inc. All rights reserved.