Class ForwardingNotificationManager

java.lang.Object
org.jppf.management.forwarding.ForwardingNotificationManager
All Implemented Interfaces:
EventListener, ForwardingNotificationEventListener, NodeConnectionListener

public class ForwardingNotificationManager extends Object implements NodeConnectionListener, ForwardingNotificationEventListener
This class implements the logic of registering JMX notification listeners to the nodes and dispatching the received notifications to the client-side JMX listeners. The actual notification filtering for the clients is implemented in the class InternalNotificationFilter.

Additionally, this class also handles a dynamic grid topology by registering as a NodeConnectionListener. This allows it to dynamically adapt when new nodes connect to the server or existing nodes disconnect: node JMX listeners are then automatically registered or unregistered and their notifications forwarded to client-side listeners whose NodeSelector matches the nodes.

Author:
Laurent Cohen
  • Constructor Details

    • ForwardingNotificationManager

      public ForwardingNotificationManager(AbstractNodeForwarding forwarder)
      Initialize this manager.
      Parameters:
      forwarder - the forwarding mbean instance.
  • Method Details

    • addNotificationListener

      public void addNotificationListener(String listenerID, org.jppf.management.NodeSelector selector, String mBeanName)
      Add the specified notification listener to the map of listeners.
      Parameters:
      listenerID - the id of the listener to add.
      selector - the slector which determines from which nodes notification should be forwarded.
      mBeanName - the name of the MBean from which to receive notifications from the selected nodes.
    • removeNotificationListener

      public void removeNotificationListener(String listenerID) throws ListenerNotFoundException
      Remove the specified notification listener from the map of listeners.
      Parameters:
      listenerID - the id of the listener to remove.
      Throws:
      ListenerNotFoundException - if the listener could not be found.
    • removeNotificationListener

      public void removeNotificationListener(org.jppf.management.forwarding.NotificationListenerWrapper wrapper) throws ListenerNotFoundException
      Remove the specified notification listener from the map of listeners.
      Parameters:
      wrapper - the listener to remove.
      Throws:
      ListenerNotFoundException - if the listener could not be found.
    • nodeConnected

      public void nodeConnected(NodeConnectionEvent event)
      Description copied from interface: NodeConnectionListener
      Called when a node is connected to the server.
      Specified by:
      nodeConnected in interface NodeConnectionListener
      Parameters:
      event - encapsulates information about the connected node.
    • nodeDisconnected

      public void nodeDisconnected(NodeConnectionEvent event)
      Description copied from interface: NodeConnectionListener
      Called when a node is disconnected from the server.
      Specified by:
      nodeDisconnected in interface NodeConnectionListener
      Parameters:
      event - encapsulates information about the connected node.
    • notificationReceived

      public void notificationReceived(ForwardingNotificationEvent event)
      Description copied from interface: ForwardingNotificationEventListener
      Called when a JMX notification is received from any node with a registered notification listener.
      Specified by:
      notificationReceived in interface ForwardingNotificationEventListener
      Parameters:
      event - encapsulates the notification and information on its origin.