edu.sc.seis.seisFile.earthworm
Class EarthwormHeartbeater

java.lang.Object
  extended by java.util.TimerTask
      extended by edu.sc.seis.seisFile.earthworm.EarthwormHeartbeater
All Implemented Interfaces:
java.lang.Runnable

public class EarthwormHeartbeater
extends java.util.TimerTask

sends heartbeats on the EarthwormEscapeOutputStream. Synchronized on the outStream and so any other thread that writes to the same EarthwormEscapeOutputStream must also synchronize on the outStream. Setting the outStream to null will disable heartbeats, and setting it back to a non-null will enable them.


Constructor Summary
EarthwormHeartbeater(EarthwormEscapeOutputStream outStream, int heartbeatSeconds, java.lang.String heartbeatMessage, int institution, int module)
           
 
Method Summary
 java.lang.String getHeartbeatMessage()
           
 int getHeartbeatSeconds()
           
 EarthwormEscapeOutputStream getOutStream()
           
 void heartbeat()
           
 boolean isVerbose()
           
 void run()
           
 void setOutStream(EarthwormEscapeOutputStream outStream)
           
 void setVerbose(boolean verbose)
           
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EarthwormHeartbeater

public EarthwormHeartbeater(EarthwormEscapeOutputStream outStream,
                            int heartbeatSeconds,
                            java.lang.String heartbeatMessage,
                            int institution,
                            int module)
Method Detail

getOutStream

public EarthwormEscapeOutputStream getOutStream()

setOutStream

public void setOutStream(EarthwormEscapeOutputStream outStream)

getHeartbeatSeconds

public int getHeartbeatSeconds()

getHeartbeatMessage

public java.lang.String getHeartbeatMessage()

isVerbose

public boolean isVerbose()

setVerbose

public void setVerbose(boolean verbose)

run

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

heartbeat

public void heartbeat()
               throws java.io.IOException
Throws:
java.io.IOException