Package org.glassfish.admin.amx.util.jmx
Class NotificationEmitterSupport
- java.lang.Object
-
- javax.management.NotificationBroadcasterSupport
-
- org.glassfish.admin.amx.util.jmx.NotificationEmitterSupport
-
- All Implemented Interfaces:
NotificationBroadcaster
,NotificationEmitter
public final class NotificationEmitterSupport extends NotificationBroadcasterSupport
Features:- Maintains information on all NotificationListeners so that queries can be made on the number of listeners, and the number of listeners of each type
- optionally sends all Notifications asynchronously via a separate Thread
For async use, a shared sender thread is used for all Notifications.
-
-
Constructor Summary
Constructors Constructor Description NotificationEmitterSupport(boolean asyncDelivery)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
void
cleanup()
int
getListenerCount()
int
getNotificationTypeListenerCount(String type)
protected void
internalSendNotification(Notification notif)
void
removeNotificationListener(NotificationListener listener)
void
removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
void
sendAll()
Synchronously (on current thread), ensure that all Notifications have been delivered.void
sendNotification(Notification notif)
Send the Notification.-
Methods inherited from class javax.management.NotificationBroadcasterSupport
getNotificationInfo, handleNotification
-
-
-
-
Method Detail
-
cleanup
public void cleanup()
-
sendAll
public void sendAll()
Synchronously (on current thread), ensure that all Notifications have been delivered.
-
getListenerCount
public int getListenerCount()
-
getNotificationTypeListenerCount
public int getNotificationTypeListenerCount(String type)
-
addNotificationListener
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
- Specified by:
addNotificationListener
in interfaceNotificationBroadcaster
- Overrides:
addNotificationListener
in classNotificationBroadcasterSupport
-
removeNotificationListener
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
- Specified by:
removeNotificationListener
in interfaceNotificationBroadcaster
- Overrides:
removeNotificationListener
in classNotificationBroadcasterSupport
- Throws:
ListenerNotFoundException
-
removeNotificationListener
public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
- Specified by:
removeNotificationListener
in interfaceNotificationEmitter
- Overrides:
removeNotificationListener
in classNotificationBroadcasterSupport
- Throws:
ListenerNotFoundException
-
internalSendNotification
protected void internalSendNotification(Notification notif)
-
sendNotification
public void sendNotification(Notification notif)
Send the Notification. If created with async=true, then this routine returns immediately and the Notification is sent on a separate Thread.- Overrides:
sendNotification
in classNotificationBroadcasterSupport
-
-