|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectstatalign.base.thread.Stoppable
public abstract class Stoppable
Ancestor for classes that can define potential "stopping points" in (some of) their methods when called from within a StoppableThread. A StoppableThread can be safely stopped by another thread when execution reaches such a point. "Pausing points" can also be defined to allow the StoppableThread to be paused at certain points.
Constructor Summary | |
---|---|
Stoppable()
Default constructor. |
Method Summary | |
---|---|
void |
pausable()
Should be called from methods of the descendant classes at points where execution is allowed to be suspended by an external thread (by calling the StoppableThread's suspendSoft() method) If the descendant object has not been created from within a StoppableThread, calling this method has no effect. |
void |
stoppable()
Should be called from methods of the descendant classes at points where execution is allowed to be stopped by an external thread (by calling the StoppableThread's stopSoft() method) If this happens, a StoppedException is thrown that can be caught at any point within the StoppableThread to do things up before exiting. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Stoppable()
Method Detail |
---|
public void pausable()
public void stoppable() throws StoppedException
StoppedException
- When stopping the execution of the StoppableThread has been
requested via stopSoft()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |