|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.lang.Thread
|
+--laur.tools.AbortableThread
This abstract class offers a general mechanism for thread abortion.
| Field Summary | |
protected boolean |
bAbort
This will be true if the user requested abort, false otherwise. |
protected boolean |
isRunning
This will be true if the thread is running, false otherwise. |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
AbortableThread()
|
|
| Method Summary | |
void |
abort()
Requests the abortion of the thread. |
protected void |
checkAbort()
This method should be called in subclasses at critical points to check whether the user requested that the execution be aborted. |
protected abstract void |
execute()
This method should be overwritten by subclasses to perform the thread actions. |
void |
run()
Runs thread. |
protected void |
terminationHook()
Called before thread terminates execution. |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected boolean bAbort
protected boolean isRunning
| Constructor Detail |
public AbortableThread()
| Method Detail |
protected abstract void execute()
public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadjava.lang.IllegalStateException - if the thread is still runningprotected void terminationHook()
public void abort()
protected void checkAbort()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||