Class TimeoutTimer


  • public class TimeoutTimer
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static org.slf4j.Logger log  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getLogPrefix()  
      java.lang.String getName()  
      int getTimeElapsedInSecs()  
      int getTimeout()  
      com.google.common.base.Stopwatch getTimer()  
      boolean isTimedOut()  
      void setLogPrefix​(java.lang.String logPrefix)  
      void setName​(java.lang.String name)  
      void setTimeout​(int timeout)
      sets the timeout for the timer and reschedules the ExecutorService with the new timeout
      void setTimer​(com.google.common.base.Stopwatch timer)  
      void stop()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • log

        protected static final org.slf4j.Logger log
    • 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