jade.core
Class NodeFailureMonitor

java.lang.Object
  extended by jade.core.NodeFailureMonitor

public abstract class NodeFailureMonitor
extends java.lang.Object

The abstract class NodeFailureMonitor provides 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 the NodeFailureMonitor can 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:

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. If false or not specified the default RMI based failure monitoring is activated. X X
jade_core_NodeFailureMonitor_udp-port Specifies 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-limit Defines 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-limit Defines 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-delay Defines 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
protected  Map childNodes
           
protected  NodeEventListener listener
           
protected  Node target
           
 
Constructor Summary
NodeFailureMonitor()
           
 
Method Summary
 void addChild(Node n)
          Add a child node for monitoring.
protected  void fireNodeAdded()
          Fire a NODE ADDED event
protected  void fireNodeReachable()
          Fire a NODE REACHABLE event
protected  void fireNodeRemoved()
          Fire a NODE REMOVED event
protected  void fireNodeUnreachable()
          Fire a NODE UNREACHABLE event
static NodeFailureMonitor getFailureMonitor()
          Factory method to create NodeFailureMonitor objects
 Node getNode()
          Return the monitored target node
static void init(jade.core.nodeMonitoring.NodeMonitoringService nms)
           
 void removeChild(Node n)
          Remove a child node from monitoring
 void start(Node n, NodeEventListener nel)
          Start the monitoring
abstract  void stop()
          Stop the monitoring
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

target

protected Node target

listener

protected NodeEventListener listener

childNodes

protected Map childNodes
Constructor Detail

NodeFailureMonitor

public NodeFailureMonitor()
Method Detail

start

public void start(Node n,
                  NodeEventListener nel)
Start the monitoring

Parameters:
n - target node to monitor
nel - 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


getFailureMonitor

public static NodeFailureMonitor getFailureMonitor()
Factory method to create NodeFailureMonitor objects

Returns:
a new instance of a NodeFailureMonitor.

init

public static void init(jade.core.nodeMonitoring.NodeMonitoringService nms)