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 voidaddNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)voidcleanup()intgetListenerCount()intgetNotificationTypeListenerCount(String type)protected voidinternalSendNotification(Notification notif)voidremoveNotificationListener(NotificationListener listener)voidremoveNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)voidsendAll()Synchronously (on current thread), ensure that all Notifications have been delivered.voidsendNotification(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:
addNotificationListenerin interfaceNotificationBroadcaster- Overrides:
addNotificationListenerin classNotificationBroadcasterSupport
-
removeNotificationListener
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
- Specified by:
removeNotificationListenerin interfaceNotificationBroadcaster- Overrides:
removeNotificationListenerin classNotificationBroadcasterSupport- Throws:
ListenerNotFoundException
-
removeNotificationListener
public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
- Specified by:
removeNotificationListenerin interfaceNotificationEmitter- Overrides:
removeNotificationListenerin 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:
sendNotificationin classNotificationBroadcasterSupport
-
-