public class Watchdog extends Object implements Runnable
ExecuteWatchdog
ExecuteWatchdog
Modifier and Type | Field and Description |
---|---|
static String |
ERROR_INVALID_TIMEOUT
Error string.
|
Constructor and Description |
---|
Watchdog(long timeout)
Constructor for Watchdog.
|
Modifier and Type | Method and Description |
---|---|
void |
addTimeoutObserver(TimeoutObserver to)
Add a timeout observer.
|
protected void |
fireTimeoutOccured()
Inform the observers that a timeout has occurred.
|
void |
removeTimeoutObserver(TimeoutObserver to)
Remove a timeout observer.
|
void |
run()
The run method of the watch dog thread.
|
void |
start()
Start the watch dog.
|
void |
stop()
Stop the watch dog.
|
public static final String ERROR_INVALID_TIMEOUT
public Watchdog(long timeout)
timeout
- the timeout to use in milliseconds (must be >= 1).public void addTimeoutObserver(TimeoutObserver to)
to
- the timeout observer to add.protected final void fireTimeoutOccured()
public void removeTimeoutObserver(TimeoutObserver to)
to
- the timeout observer to remove.public void run()
run
in interface Runnable
Thread.run()
public void start()
public void stop()