org.apache.geronimo.messaging.cluster
Class ClusterHBReceiver

java.lang.Object
  extended byorg.apache.geronimo.messaging.cluster.ClusterHBReceiver
All Implemented Interfaces:
org.apache.geronimo.gbean.GBeanLifecycle

public class ClusterHBReceiver
extends Object
implements org.apache.geronimo.gbean.GBeanLifecycle

Heartbeats listener.
It joins the multicast group associated to the bound cluster and monitors node heartbeats. When an heartbeat is received for the very first time, it adds it to the underlying cluster. Conversely, when a configurable number of heartbeats have been missed, it removes it from the underlying cluster.
This service must be executed by a single node of the cluster. If the node running this service fails, then another node of the cluster should start automatically this service.

Version:
$Revision: 1.2 $ $Date: 2004/07/20 00:01:54 $

Field Summary
static org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
           
 
Constructor Summary
ClusterHBReceiver(Cluster aCluster, org.apache.geronimo.pool.ClockPool aClockPool, int aNbMissed)
          Creates an heartbeat listener.
 
Method Summary
 void doFail()
           
 void doStart()
           
 void doStop()
           
static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GBEAN_INFO

public static final org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
Constructor Detail

ClusterHBReceiver

public ClusterHBReceiver(Cluster aCluster,
                         org.apache.geronimo.pool.ClockPool aClockPool,
                         int aNbMissed)
Creates an heartbeat listener.

Parameters:
aCluster - Cluster to be notified when a new node has been detected or when aNbMissed heartbeats have been missed and the associated node needs to be drop from the cluster.
aClockPool - To execute periodical operations.
aNbMissed - Number of heartbeats which can be missed safely. If more than this number of heartbeats are missed, then the associated node is dropped.
Method Detail

doStart

public void doStart()
             throws org.apache.geronimo.gbean.WaitingException,
                    Exception
Specified by:
doStart in interface org.apache.geronimo.gbean.GBeanLifecycle
Throws:
org.apache.geronimo.gbean.WaitingException
Exception

doStop

public void doStop()
            throws org.apache.geronimo.gbean.WaitingException,
                   Exception
Specified by:
doStop in interface org.apache.geronimo.gbean.GBeanLifecycle
Throws:
org.apache.geronimo.gbean.WaitingException
Exception

doFail

public void doFail()
Specified by:
doFail in interface org.apache.geronimo.gbean.GBeanLifecycle

getGBeanInfo

public static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()


Copyright © 2003-2005 Apache Software Foundation. All Rights Reserved.