com.javageeks.client
Class HeartbeatListenerClient

java.lang.Object
  |
  +--com.javageeks.client.HeartbeatListenerClient
All Implemented Interfaces:
java.lang.Runnable

public class HeartbeatListenerClient
extends java.lang.Object
implements java.lang.Runnable


Constructor Summary
HeartbeatListenerClient(java.lang.String host, int port)
          Convenience constructor--assumes defaults of "PING", 15 seconds, and 3 attempts
HeartbeatListenerClient(java.lang.String host, int port, java.lang.String msg, int interval, int giveUpCount, java.lang.Thread thread)
          "Complete" constructor--initialize with all given values
 
Method Summary
 void addListener(HeartbeatListener listener)
          Add a HeartbeatListener to the list of interested parties
static void main(java.lang.String[] args)
          Test driver; for testing purposes only.
 void removeListener(HeartbeatListener listener)
          Remove a HeartbeatListener from the list of notification targets on heartbeat pings or failures
 void run()
           
 void startListening()
          Begin listening for heartbeat messages
 void stopListening()
          Cease listening for heartbeat messages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeartbeatListenerClient

public HeartbeatListenerClient(java.lang.String host,
                               int port,
                               java.lang.String msg,
                               int interval,
                               int giveUpCount,
                               java.lang.Thread thread)
"Complete" constructor--initialize with all given values

HeartbeatListenerClient

public HeartbeatListenerClient(java.lang.String host,
                               int port)
Convenience constructor--assumes defaults of "PING", 15 seconds, and 3 attempts
Method Detail

addListener

public void addListener(HeartbeatListener listener)
Add a HeartbeatListener to the list of interested parties

removeListener

public void removeListener(HeartbeatListener listener)
Remove a HeartbeatListener from the list of notification targets on heartbeat pings or failures

startListening

public void startListening()
Begin listening for heartbeat messages

stopListening

public void stopListening()
Cease listening for heartbeat messages

run

public void run()
Specified by:
run in interface java.lang.Runnable

main

public static void main(java.lang.String[] args)
Test driver; for testing purposes only.