APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.management

public abstract Class NotificationEmitterSupport

extends Object
implements NotificationEmitter
Class Inheritance
All Implemented Interfaces
javax.management.NotificationEmitter, javax.management.NotificationBroadcaster
Known Direct Subclasses
sun.management.MemoryImpl, sun.management.MemoryManagerImpl
Imports
javax.management.ListenerNotFoundException, .MBeanNotificationInfo, .Notification, .NotificationEmitter, .NotificationFilter, .NotificationListener, java.util.List, .ArrayList, .Collections

Abstract helper class for notification emitter support.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private List<NotificationEmitterSupport.ListenerInfo>
listenerList

Current list of listeners, a List of ListenerInfo.

private Object

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public void
public abstract MBeanNotificationInfo[]
getNotificationInfo()

Redeclares javax.management.NotificationBroadcaster.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.

public boolean
public void
public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

listenerListback to summary
private List<NotificationEmitterSupport.ListenerInfo> 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.

listenerLockback to summary
private Object listenerLock

Constructor Detail

NotificationEmitterSupportback to summary
protected NotificationEmitterSupport()

Method Detail

addNotificationListenerback to summary
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)

Implements javax.management.NotificationBroadcaster.addNotificationListener.

Doc from javax.management.NotificationBroadcaster.addNotificationListener.

Adds a listener to this MBean.

getNotificationInfoback to summary
public abstract MBeanNotificationInfo[] getNotificationInfo()

Redeclares javax.management.NotificationBroadcaster.getNotificationInfo.

Doc from javax.management.NotificationBroadcaster.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.

hasListenersback to summary
public boolean hasListeners()
removeNotificationListenerback to summary
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException

Implements javax.management.NotificationBroadcaster.removeNotificationListener.

Doc from javax.management.NotificationBroadcaster.removeNotificationListener.

Removes 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.

Exceptions
ListenerNotFoundException:
The listener is not registered with the MBean.
removeNotificationListenerback to summary
public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException

Implements javax.management.NotificationEmitter.removeNotificationListener.

Doc from javax.management.NotificationEmitter.removeNotificationListener.

Removes a listener from this 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.

Exceptions
ListenerNotFoundException:
The listener is not registered with the MBean, or it is not registered with the given filter and handback.
sendNotificationback to summary
public void sendNotification(Notification notification)
sun.management back to summary

private Class NotificationEmitterSupport.ListenerInfo

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv NotificationFilter
pack-priv Object
public NotificationListener

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

filterback to summary
pack-priv NotificationFilter filter
handbackback to summary
pack-priv Object handback
listenerback to summary
public NotificationListener listener

Constructor Detail

ListenerInfoback to summary
public ListenerInfo(NotificationListener listener, NotificationFilter filter, Object handback)