Package org.apache.tools.ant.util
Class Watchdog
- java.lang.Object
- 
- org.apache.tools.ant.util.Watchdog
 
- 
- All Implemented Interfaces:
- java.lang.Runnable
 
 public class Watchdog extends java.lang.Object implements java.lang.RunnableGeneralization ofExecuteWatchdog- Since:
- Ant 1.5
- See Also:
- ExecuteWatchdog
 
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringERROR_INVALID_TIMEOUTError string.
 - 
Constructor SummaryConstructors Constructor Description Watchdog(long timeout)Constructor for Watchdog.
 - 
Method SummaryModifier and Type Method Description voidaddTimeoutObserver(TimeoutObserver to)Add a timeout observer.protected voidfireTimeoutOccured()Inform the observers that a timeout has occurred.voidremoveTimeoutObserver(TimeoutObserver to)Remove a timeout observer.voidrun()The run method of the watch dog thread.voidstart()Start the watch dog.voidstop()Stop the watch dog.
 
- 
- 
- 
Field Detail- 
ERROR_INVALID_TIMEOUTpublic static final java.lang.String ERROR_INVALID_TIMEOUT Error string. "timeout less than 1."- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
addTimeoutObserverpublic void addTimeoutObserver(TimeoutObserver to) Add a timeout observer.- Parameters:
- to- the timeout observer to add.
 
 - 
removeTimeoutObserverpublic void removeTimeoutObserver(TimeoutObserver to) Remove a timeout observer.- Parameters:
- to- the timeout observer to remove.
 
 - 
fireTimeoutOccuredprotected final void fireTimeoutOccured() Inform the observers that a timeout has occurred. This happens in the watchdog thread.
 - 
startpublic void start() Start the watch dog.
 - 
stoppublic void stop() Stop the watch dog.
 - 
runpublic 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.- Specified by:
- runin interface- java.lang.Runnable
 
 
- 
 
-