org.aitools.programd.util
Class Heart

java.lang.Object
  extended by org.aitools.programd.util.Heart

public class Heart
extends Object

A Heart beats. At a configurable interval, it calls pulse() methods on some objects (currently only the parent static Multiplexor) in order to provide assurance that the bot server is alive.

Author:
Noel Bush

Constructor Summary
Heart(int pulserateToUse)
          Creates a new Heart with the given pulse rate.
 
Method Summary
 void addPulse(Pulse pulse)
          Adds a Pulse to the registered list.
 void pulse()
          Emits any registered pulses.
 void start()
          Starts the heart (if the pulse is greater than zero).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Heart

public Heart(int pulserateToUse)
Creates a new Heart with the given pulse rate.

Parameters:
pulserateToUse - the pulse rate to use
Method Detail

start

public void start()
Starts the heart (if the pulse is greater than zero).


addPulse

public void addPulse(Pulse pulse)
Adds a Pulse to the registered list.

Parameters:
pulse - the Pulse to be added

pulse

public void pulse()
Emits any registered pulses.