Package edu.sc.seis.seisFile.earthworm
Class EarthwormHeartbeater
java.lang.Object
java.util.TimerTask
edu.sc.seis.seisFile.earthworm.EarthwormHeartbeater
- All Implemented Interfaces:
Runnable
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
ConstructorsConstructorDescriptionEarthwormHeartbeater
(EarthwormEscapeOutputStream outStream, int heartbeatSeconds, String heartbeatMessage, int institution, int module) -
Method Summary
Modifier and TypeMethodDescriptionint
void
boolean
void
run()
void
setOutStream
(EarthwormEscapeOutputStream outStream) void
setVerbose
(boolean verbose) Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
-
Constructor Details
-
EarthwormHeartbeater
public EarthwormHeartbeater(EarthwormEscapeOutputStream outStream, int heartbeatSeconds, String heartbeatMessage, int institution, int module)
-
-
Method Details
-
getOutStream
-
setOutStream
-
getHeartbeatSeconds
public int getHeartbeatSeconds() -
getHeartbeatMessage
-
isVerbose
public boolean isVerbose() -
setVerbose
public void setVerbose(boolean verbose) -
run
public void run() -
heartbeat
- Throws:
IOException
-