Class: sun.management.NotificationEmitterSupport
- abstract class NotificationEmitterSupport
- implements NotificationEmitter
Abstract helper class for notification emitter support.
Methods
-
NotificationEmitterSupporttop
protected NotificationEmitterSupport() -
addNotificationListenertop
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)Adds a listener to this MBean.- Specified by:
- addNotificationListener from NotificationBroadcaster
-
getNotificationInfotop
public abstract MBeanNotificationInfo[] getNotificationInfo()Returns an array indicating, for each notification this MBean may send, the name of the Java class of the notification and the notification type.
It is not illegal for the MBean to send notifications not described in this array. However, some clients of the MBean server may depend on the array being complete for their correct functioning.
- Specified by:
- getNotificationInfo from NotificationBroadcaster
-
hasListenerstop
boolean hasListeners() -
removeNotificationListenertop
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundExceptionRemoves a listener from this MBean. If the listener has been registered with different handback objects or notification filters, all entries corresponding to the listener will be removed.- Specified by:
- removeNotificationListener from NotificationBroadcaster
-
removeNotificationListenertop
public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundExceptionRemoves a listener from this MBean. The MBean must have a listener that exactly matches the given
listener,filter, andhandbackparameters. If there is more than one such listener, only one is removed.The
filterandhandbackparameters may be null if and only if they are null in a listener to be removed.- Specified by:
- removeNotificationListener from NotificationEmitter
-
sendNotificationtop
void sendNotification(Notification notification)
Fields
-
listenerList
Current list of listeners, a List of ListenerInfo. The object referenced by this field is never modified. Instead, the field is set to a new object when a listener is added or removed, within a synchronized(this). In this way, there is no need to synchronize when traversing the list to send a notification to the listeners in it. That avoids potential deadlocks if the listeners end up depending on other threads that are themselves accessing this NotificationBroadcasterSupport. -
listenerLock
private Object listenerLock
