java.lang.Runnable
public class Watchdog
extends java.lang.Object
implements java.lang.Runnable
ExecuteWatchdog
ExecuteWatchdog
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
ERROR_INVALID_TIMEOUT |
Error string.
|
Constructor | Description |
---|---|
Watchdog(long timeout) |
Constructor for Watchdog.
|
Modifier and Type | Method | 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 java.lang.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.public void removeTimeoutObserver(TimeoutObserver to)
to
- the timeout observer to remove.protected final void fireTimeoutOccured()
public void start()
public void stop()
public void run()
run
in interface java.lang.Runnable