| java.lang.Object snow.concurrent.InterruptableTask
InterruptableTask | abstract public class InterruptableTask implements Callable<T>,Runnable(Code) | | wraps a runnable into an interruptable task.
I.e. creates a thread that can be interrupted.
should only be interrupted when not stopping itself correctely with the Interrupter
Usage example
InterruptableTask actualTask = new InterruptableTask()
{
public void run()
{
...
if(interrupter.getShouldStopEvaluation()) return;
}
};
Thread t = new Thread(actualTask);
t.setPriority(Thread.MIN_PRIORITY);
t.start();
|
InterruptableTask | public InterruptableTask()(Code) | | |
call | final public T call() throws Exception(Code) | | creates a thread to evaluate this task and Waits until completion, returning null
|
isExecuting | public boolean isExecuting()(Code) | | |
kill | public void kill()(Code) | | use only if request stop has not succeded.
This kills the thread.
BE CAREFUL: if the therad calls EventQueue.invokeAndWait, and catch Exception without throwing them
the thread continues !!
|
requestStop | public void requestStop()(Code) | | |
|
|