Constructor and Description |
---|
SimpleWatchdog(long delay)
Supervises some activity.
|
SimpleWatchdog(long delay,
Timer timer)
Supervises some activity.
|
Modifier and Type | Method and Description |
---|---|
void |
arm()
Starts supervising.
|
void |
feed()
Feeds the watchdog.
|
void |
setWatchdogListener(WatchdogListener watchdogListener)
Sets the watchdog listener that will receive the watchdog notifications.
|
void |
stop()
Stops to supervise.
|
public SimpleWatchdog(long delay)
delay
- the minimum duration of inactivity before the listener is notified.public SimpleWatchdog(long delay, Timer timer) throws NullPointerException
delay
- the minimum duration of inactivity before the listener is notified.timer
- the timer to use.NullPointerException
- when the timer is null
.public void arm()
Watchdog
public void setWatchdogListener(WatchdogListener watchdogListener)
Watchdog
setWatchdogListener
in interface Watchdog
watchdogListener
- the watchdog listener to notify.