org.demac.management.thread
Class HeartbeatReceiver

java.lang.Object
  extended by java.lang.Thread
      extended by org.demac.management.thread.HeartbeatReceiver
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
HeartbeatReceiverImpl

public abstract class HeartbeatReceiver
extends java.lang.Thread

A HeartbeatReceiver calculates the maximum arrival time of the next heartbeat and takes the right actions (e.g. starting recovery) if the timeout is over.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
HeartbeatReceiver()
           
 
Method Summary
abstract  void dontStartAsCoordinator()
          This method is used to prevent the HeartbeatReceiver from starting a RecoveryCoordination as a Coordinator.
abstract  boolean isStopped()
          Determines whether the HeartbeatReceiver is stopped or not.
abstract  void newHeartbeat(int counter)
          This method is used to tell the HeartbeatReceiver that a new heartbeat arrived.
abstract  void stopHeartbeatReceiver()
          This method is used to stop the HeartbeatReceiver.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HeartbeatReceiver

public HeartbeatReceiver()
Method Detail

dontStartAsCoordinator

public abstract void dontStartAsCoordinator()
This method is used to prevent the HeartbeatReceiver from starting a RecoveryCoordination as a Coordinator.


newHeartbeat

public abstract void newHeartbeat(int counter)
This method is used to tell the HeartbeatReceiver that a new heartbeat arrived.

Parameters:
the - consecutive counter of the heartbeat which determines which heartbeat arrived.

isStopped

public abstract boolean isStopped()
Determines whether the HeartbeatReceiver is stopped or not.

Returns:
true if the HeartbeatReceiver is stopped, false else.

stopHeartbeatReceiver

public abstract void stopHeartbeatReceiver()
This method is used to stop the HeartbeatReceiver.