Class ExecuteWatchdog

java.lang.Object
org.apache.tools.ant.taskdefs.ExecuteWatchdog
All Implemented Interfaces:
TimeoutObserver

public class ExecuteWatchdog extends Object implements TimeoutObserver
Destroys a process running for too long. For example:
 ExecuteWatchdog watchdog = new ExecuteWatchdog(30000);
 Execute exec = new Execute(myloghandler, watchdog);
 exec.setCommandLine(mycmdline);
 int exitvalue = exec.execute();
 if (Execute.isFailure(exitvalue) && watchdog.killedProcess()) {
              // it was killed on purpose by the watchdog
 }
 
Since:
Ant 1.2
See Also: