Class TimeoutTimer
- java.lang.Object
-
- org.openmuc.jeebus.ship.state.timeout.TimeoutTimer
-
public class TimeoutTimer extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Loggerlog
-
Constructor Summary
Constructors Constructor Description TimeoutTimer(java.lang.String name, int timeout, TimeoutCallback timeoutCB)TimeoutTimer(java.lang.String name, int timeout, TimeoutCallback timeoutCB, java.lang.String logPrefix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetLogPrefix()java.lang.StringgetName()intgetTimeElapsedInSecs()intgetTimeout()com.google.common.base.StopwatchgetTimer()booleanisTimedOut()voidsetLogPrefix(java.lang.String logPrefix)voidsetName(java.lang.String name)voidsetTimeout(int timeout)sets the timeout for the timer and reschedules the ExecutorService with the new timeoutvoidsetTimer(com.google.common.base.Stopwatch timer)voidstop()
-
-
-
Constructor Detail
-
TimeoutTimer
public TimeoutTimer(java.lang.String name, int timeout, TimeoutCallback timeoutCB)
-
TimeoutTimer
public TimeoutTimer(java.lang.String name, int timeout, TimeoutCallback timeoutCB, java.lang.String logPrefix)
-
-
Method Detail
-
stop
public void stop()
-
isTimedOut
public boolean isTimedOut()
-
getTimer
public com.google.common.base.Stopwatch getTimer()
-
setTimer
public void setTimer(com.google.common.base.Stopwatch timer)
-
getTimeElapsedInSecs
public int getTimeElapsedInSecs()
-
getLogPrefix
public java.lang.String getLogPrefix()
-
setLogPrefix
public void setLogPrefix(java.lang.String logPrefix)
-
getName
public java.lang.String getName()
-
setName
public void setName(java.lang.String name)
-
getTimeout
public int getTimeout()
-
setTimeout
public void setTimeout(int timeout)
sets the timeout for the timer and reschedules the ExecutorService with the new timeout- Parameters:
timeout- the timeout in seconds
-
-