| java.lang.Object net.sourceforge.groboutils.util.thread.v1.TimedProcess
TimedProcess | public class TimedProcess (Code) | | A Utility to run a task in a thread, and to kill it if the thread runs
too long. This will first attempt an interrupt() on the thread. If that
doesn't work, then a stop() will be executed. This is a well-documented
bad practice, so you have been warned!
author: Matt Albrecht groboclown@users.sourceforge.net version: $Date: 2003/02/10 22:52:49 $ since: 15-Mar-2002 |
Inner Class :public static interface RunnableKiller | |
REASONABLE_TIME | final public static int REASONABLE_TIME(Code) | | |
TimedProcess | protected TimedProcess()(Code) | | |
joinThread | protected void joinThread(Thread t, long joinTime)(Code) | | |
runTimed | public void runTimed(Runnable process, long waitTimeMillis) throws InterruptedException(Code) | | Runs the given process in a Thread. If it does not stop within the
specified time, then attempts will be made to kill the thread
(see earlier text). If the process did not complete in the specified
time, an InterruptedException will be thrown.
exception: InterruptedException - if the process did not complete withinthe given time frame. |
runTimed | public void runTimed(Runnable process, long waitTimeMillis, RunnableKiller processEnder) throws InterruptedException(Code) | | Runs the given process in a Thread. If it does not stop within the
specified time, then attempts will be made to kill the thread
(see earlier text). If the process did not complete in the specified
time, an InterruptedException will be thrown.
exception: InterruptedException - if the process did not complete withinthe given time frame. |
|
|