Package jade.core
Class NodeFailureMonitor
- java.lang.Object
-
- jade.core.NodeFailureMonitor
-
- Direct Known Subclasses:
BlockingNodeFailureMonitor
public abstract class NodeFailureMonitor extends Object
The abstract classNodeFailureMonitorprovides a basic implementation for classes that are used to monitor the availability of nodes and detect node failures. In addition to that it provides static methods to initialize and create instances of monitors depending on the current settings in the profile. An instance of a subclass of theNodeFailureMonitorcan only supervise a single node. If there are additional nodes in the same JVM, you can add these as child nodes. A child node is not supervised directly. Instead it has always the same state than its parent node. So if the parent node gets unreachable automatically all its child nodes will turn to the state unreachable.Since JADE 3.3 there are two different types of failure monitoring available:
- Blocking failure monitoring based on RMI (Default)
- UDP based failure monitoring
The failure monitoring can be configured through the following profile parameter:
Parameter Description PC MC jade_core_NodeFailureMonitor_udp(*)If true, indicates that the UDP based failure monitoring has to be used. Iffalseor not specified the default RMI based failure monitoring is activated.X X jade_core_NodeFailureMonitor_udp-portSpecifies the port number where the main container will listen for UDP pings. The default value is 28000. (This parameter is only used in combination with (*)X X jade_core_NodeFailureMonitor_udp-ping-delay-limitDefines the maximum time (in milliseconds) the main container will wait for incoming ping messages. The default value is 3000. (This parameter is only used in combination with (*)X jade_core_NodeFailureMonitor_udp-unreachable-limitDefines the maximum time (in milliseconds) a node can be temporarily unreachable until it gets removed from the platform. The default value is 10.000. (This parameter is only used in combination with (*)X jade_core_NodeFailureMonitor_udp-ping-delayDefines the time interval (in milliseconds) in which a peripheral container sends UDP ping messages to the main container. The default value is 1.000. (This parameter is only used in combination with (*)X MC ... main container PC ... peripheral container
- Author:
- Roland Mungenast - Profactor
- See Also:
NodeEventListener
-
-
Field Summary
Fields Modifier and Type Field Description protected MapchildNodesprotected NodeEventListenerlistenerprotected Nodetarget
-
Constructor Summary
Constructors Constructor Description NodeFailureMonitor()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddChild(Node n)Add a child node for monitoring.protected voidfireNodeAdded()Fire a NODE ADDED eventprotected voidfireNodeReachable()Fire a NODE REACHABLE eventprotected voidfireNodeRemoved()Fire a NODE REMOVED eventprotected voidfireNodeUnreachable()Fire a NODE UNREACHABLE eventstatic NodeFailureMonitorgetDefaultFailureMonitor()static NodeFailureMonitorgetFailureMonitor()Factory method to create NodeFailureMonitor objectsNodegetNode()Return the monitored target nodestatic voidinit(NodeMonitoringService nms)voidremoveChild(Node n)Remove a child node from monitoringStringrequireService()voidstart(Node n, NodeEventListener nel)Start the monitoringabstract voidstop()Stop the monitoring
-
-
-
Field Detail
-
target
protected Node target
-
listener
protected NodeEventListener listener
-
childNodes
protected Map childNodes
-
-
Method Detail
-
start
public void start(Node n, NodeEventListener nel)
Start the monitoring- Parameters:
n- target node to monitornel- listener to inform about new events
-
stop
public abstract void stop()
Stop the monitoring
-
addChild
public void addChild(Node n)
Add a child node for monitoring.- Parameters:
n- child node
-
removeChild
public void removeChild(Node n)
Remove a child node from monitoring- Parameters:
n- child node
-
getNode
public Node getNode()
Return the monitored target node
-
fireNodeAdded
protected void fireNodeAdded()
Fire a NODE ADDED event
-
fireNodeRemoved
protected void fireNodeRemoved()
Fire a NODE REMOVED event
-
fireNodeReachable
protected void fireNodeReachable()
Fire a NODE REACHABLE event
-
fireNodeUnreachable
protected void fireNodeUnreachable()
Fire a NODE UNREACHABLE event
-
requireService
public String requireService()
-
getFailureMonitor
public static NodeFailureMonitor getFailureMonitor()
Factory method to create NodeFailureMonitor objects- Returns:
- a new instance of a
NodeFailureMonitor.
-
getDefaultFailureMonitor
public static NodeFailureMonitor getDefaultFailureMonitor()
-
init
public static void init(NodeMonitoringService nms)
-
-