Please note that this documentation is not final and is subject to change.

Java™ Platform
Standard Ed. 7

DRAFT ea-b76

javax.management.event
Interface NotificationManager

All Known Subinterfaces:
MBeanServer, MBeanServerConnection, MBeanServerForwarder
All Known Implementing Classes:
EventClient, IdentityMBeanServerForwarder, MBeanServerConnectionWrapper, MBeanServerSupport

public interface NotificationManager

This interface specifies methods to add and remove notification listeners on named MBeans.


Method Summary
Modifier and Type Method and Description
 void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
          Adds a listener to a registered MBean.
 void removeNotificationListener(ObjectName name, NotificationListener listener)
          Removes a listener from a registered MBean.
 void removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
          Removes a listener from a registered MBean.
 

Method Detail

addNotificationListener

void addNotificationListener(ObjectName name,
                             NotificationListener listener,
                             NotificationFilter filter,
                             Object handback)
                             throws InstanceNotFoundException,
                                    IOException

Adds a listener to a registered MBean. Notifications emitted by the MBean will be forwarded to the listener.

Parameters:
name - The name of the MBean on which the listener should be added.
listener - The listener object which will handle the notifications emitted by the registered MBean.
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 MBean name provided does not match any of the registered MBeans.
IOException - A communication problem occurred when talking to the MBean server.
See Also:
removeNotificationListener(ObjectName, NotificationListener), removeNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object)

removeNotificationListener

void removeNotificationListener(ObjectName name,
                                NotificationListener listener)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException,
                                       IOException

Removes a listener from a registered MBean.

If the listener is registered more than once, perhaps with different filters or callbacks, this method will remove all those registrations.

Parameters:
name - The name of the MBean on which the listener should be removed.
listener - The listener to be removed.
Throws:
InstanceNotFoundException - The MBean name provided does not match any of the registered MBeans.
ListenerNotFoundException - The listener is not registered in the MBean.
IOException - A communication problem occurred when talking to the MBean server.
See Also:
addNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object)

removeNotificationListener

void removeNotificationListener(ObjectName name,
                                NotificationListener listener,
                                NotificationFilter filter,
                                Object handback)
                                throws InstanceNotFoundException,
                                       ListenerNotFoundException,
                                       IOException

Removes a listener from a registered MBean.

The MBean must have a listener that exactly matches the given listener, filter, and handback parameters. If there is more than one such listener, only one is removed.

The filter and handback parameters may be null if and only if they are null in a listener to be removed.

Parameters:
name - The name of the MBean on which the listener should be removed.
listener - The listener to be removed.
filter - The filter that was specified when the listener was added.
handback - The handback that was specified when the listener was added.
Throws:
InstanceNotFoundException - The MBean name provided does not match any of the registered MBeans.
ListenerNotFoundException - The listener is not registered in the MBean, or it is not registered with the given filter and handback.
IOException - A communication problem occurred when talking to the MBean server.
See Also:
addNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object)

Java™ Platform
Standard Ed. 7

DRAFT ea-b76

Submit a bug or feature

Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.