verinec.util
Class AbstractProgramExec.TimeoutWatcher

java.lang.Object
  extended by java.util.TimerTask
      extended by verinec.util.AbstractProgramExec.TimeoutWatcher
All Implemented Interfaces:
Runnable
Enclosing class:
AbstractProgramExec

public class AbstractProgramExec.TimeoutWatcher
extends TimerTask

A TimerTask that will call AbstractProgramExec.timeout() when invoked if the ProgramExec instance has not finished.

You can instantiate a TimeoutWatcher using
ProgramExec p; java.util.Timer t;
...
p.execAsync(); //returns immediately
t.schedule(p.new TimeoutWatcher(), 10000); //timeout after 10 seconds
...


Constructor Summary
AbstractProgramExec.TimeoutWatcher()
           
 
Method Summary
 void run()
          Aborts execution if program is still running.
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractProgramExec.TimeoutWatcher

public AbstractProgramExec.TimeoutWatcher()
Method Detail

run

public void run()
Aborts execution if program is still running.

Specified by:
run in interface Runnable
Specified by:
run in class TimerTask

Copyright © 2005 Verinec, DIUF