Package org.jppf.management.forwarding
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 Summary
ConstructorsConstructorDescriptionInitialize this manager. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNotificationListener(String listenerID, org.jppf.management.NodeSelector selector, String mBeanName) Add the specified notification listener to the map of listeners.voidnodeConnected(NodeConnectionEvent event) Called when a node is connected to the server.voidCalled when a node is disconnected from the server.voidCalled when a JMX notification is received from any node with a registered notification listener.voidremoveNotificationListener(String listenerID) Remove the specified notification listener from the map of listeners.voidremoveNotificationListener(org.jppf.management.forwarding.NotificationListenerWrapper wrapper) Remove the specified notification listener from the map of listeners.
-
Constructor Details
-
ForwardingNotificationManager
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
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
Description copied from interface:NodeConnectionListenerCalled when a node is connected to the server.- Specified by:
nodeConnectedin interfaceNodeConnectionListener- Parameters:
event- encapsulates information about the connected node.
-
nodeDisconnected
Description copied from interface:NodeConnectionListenerCalled when a node is disconnected from the server.- Specified by:
nodeDisconnectedin interfaceNodeConnectionListener- Parameters:
event- encapsulates information about the connected node.
-
notificationReceived
Description copied from interface:ForwardingNotificationEventListenerCalled when a JMX notification is received from any node with a registered notification listener.- Specified by:
notificationReceivedin interfaceForwardingNotificationEventListener- Parameters:
event- encapsulates the notification and information on its origin.
-