org.apache.tools.ant.util
Class Watchdog
java.lang.Object
org.apache.tools.ant.util.Watchdog
- Runnable
public class Watchdog
extends java.lang.Object
implements Runnable
Generalization of ExecuteWatchdog
- Ant 1.5
ExecuteWatchdog
Watchdog(long timeout) - Constructor for Watchdog.
|
Watchdog
public Watchdog(long timeout)
Constructor for Watchdog.
timeout
- the timeout to use in milliseconds (must be >= 1).
addTimeoutObserver
public void addTimeoutObserver(TimeoutObserver to)
Add a timeout observer.
to
- the timeout observer to add.
fireTimeoutOccured
protected final void fireTimeoutOccured()
Inform the observers that a timeout has occured.
removeTimeoutObserver
public void removeTimeoutObserver(TimeoutObserver to)
Remove a timeout observer.
to
- the timeout observer to remove.
run
public void run()
The run method of the watch dog thread.
This simply does a wait for the timeout time, and
if the stop flag has not been set when the wait has returned or
has been interrupted, the watch dog listeners are informed.
start
public void start()
Start the watch dog.
stop
public void stop()
Stop the watch dog.
Copyright B) 2000-2005 Apache Software Foundation. All Rights Reserved.