org.jboss.mx.util
Class JBossNotificationBroadcasterSupport

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport
All Implemented Interfaces:
NotificationBroadcaster (src) , NotificationEmitter (src)
Direct Known Subclasses:
AsynchNotificationBroadcasterSupport (src) , DistributedStateUser (src) , DRMUser (src) , Host (src) , ServiceController (src) , ServiceMBeanSupport (src)

public class JBossNotificationBroadcasterSupport
extends java.lang.Object
implements NotificationEmitter (src)

A helper class for notification broadcasters/emitters


Constructor Summary
JBossNotificationBroadcasterSupport()
          Construct the new notification broadcaster support object
 
Method Summary
 void addNotificationListener(NotificationListener (src)  listener, NotificationFilter (src)  filter, java.lang.Object handback)
          Add a listener to an MBean.
 MBeanNotificationInfo (src) [] getNotificationInfo()
          Returns the notification metadata associated with the MBean.
 void handleNotification(NotificationListener (src)  listener, Notification (src)  notification, java.lang.Object handback)
          Handle the notification, the default implementation is to synchronously invoke the listener.
 void removeNotificationListener(NotificationListener (src)  listener)
          Removes a listener from an MBean.
 void removeNotificationListener(NotificationListener (src)  listener, NotificationFilter (src)  filter, java.lang.Object handback)
          Removes a listener from the Emitter.
 void sendNotification(Notification (src)  notification)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JBossNotificationBroadcasterSupport

public JBossNotificationBroadcasterSupport()
Construct the new notification broadcaster support object

Method Detail

addNotificationListener

public void addNotificationListener(NotificationListener (src)  listener,
                                    NotificationFilter (src)  filter,
                                    java.lang.Object handback)
Description copied from interface: NotificationBroadcaster (src)
Add a listener to an MBean.

Specified by:
addNotificationListener in interface NotificationBroadcaster (src)
Parameters:
listener - implementation of the listener object
filter - implementation of the filter object or null if no filtering is required
handback - A handback object associated with each notification sent by this notification broadcaster.

removeNotificationListener

public void removeNotificationListener(NotificationListener (src)  listener)
                                throws ListenerNotFoundException (src) 
Description copied from interface: NotificationBroadcaster (src)
Removes a listener from an MBean.

Specified by:
removeNotificationListener in interface NotificationBroadcaster (src)
Parameters:
listener - the listener object to remove
Throws:
ListenerNotFoundException (src) - if the listener was not found

removeNotificationListener

public void removeNotificationListener(NotificationListener (src)  listener,
                                       NotificationFilter (src)  filter,
                                       java.lang.Object handback)
                                throws ListenerNotFoundException (src) 
Description copied from interface: NotificationEmitter (src)
Removes a listener from the Emitter.

Only the listener, filter, handback triplet is removed

Specified by:
removeNotificationListener in interface NotificationEmitter (src)
Parameters:
listener - the listener object to remove
filter - the filter registered with the listener
handback - the handback object associated with the registered listener
Throws:
ListenerNotFoundException (src) - if the listener was not found

getNotificationInfo

public MBeanNotificationInfo (src) [] getNotificationInfo()
Description copied from interface: NotificationBroadcaster (src)
Returns the notification metadata associated with the MBean.

Specified by:
getNotificationInfo in interface NotificationBroadcaster (src)
Returns:
MBean's notification metadata
See Also:
MBeanNotificationInfo (src)

sendNotification

public void sendNotification(Notification (src)  notification)

handleNotification

public void handleNotification(NotificationListener (src)  listener,
                               Notification (src)  notification,
                               java.lang.Object handback)
Handle the notification, the default implementation is to synchronously invoke the listener.

Parameters:
listener - the listener to notify
notification - the notification
handback - the handback object