org.ros.concurrent
Class WatchdogTimer

java.lang.Object
  extended by org.ros.concurrent.WatchdogTimer

public class WatchdogTimer
extends java.lang.Object

A WatchdogTimer expects to receive a pulse() at least once every period units. Once per every period in which a pulse() is not received, the provided Runnable will be executed.


Constructor Summary
WatchdogTimer(java.util.concurrent.ScheduledExecutorService scheduledExecutorService, long period, java.util.concurrent.TimeUnit unit, java.lang.Runnable runnable)
           
 
Method Summary
 void cancel()
           
 void pulse()
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WatchdogTimer

public WatchdogTimer(java.util.concurrent.ScheduledExecutorService scheduledExecutorService,
                     long period,
                     java.util.concurrent.TimeUnit unit,
                     java.lang.Runnable runnable)
Method Detail

start

public void start()

pulse

public void pulse()

cancel

public void cancel()