|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||
java.lang.Objectjava.lang.Enum<AbstractTask.State>
Task.AbstractTask.State
public static enum AbstractTask.State
List of all the possible states that any kind of Task (Network, non network, etc) may have. The lifecycle begins with Started, and ends in Stopped (regardless of the outcome). Once, Stopped, it may transition to OK, Interrupted, Err, Cancelled. For networked tasks, that are not online, it goes from Started to Stopped to NotOnline. Bascially, Stopped is called pretty much any time after Started - you can put code in there to turn off busy label, etc or something like that.
| Enum Constant Summary | |
|---|---|
Cancelled
After task is Started, if AbstractTask.getSwingWorker().cancel() is called, this state is reached as soon
as the SwingWorker's (and TaskExecutorIF's) doInBackground method completes (is done()). |
|
Err
after task is Stopped, result is bad - Err. |
|
Interrupted
Task is interrupted. |
|
NotOnline
after task is Stopped, if container is not in ONLINE mode. |
|
OK
after task is Stopped, result is good - OK |
|
Started
task is started |
|
Stopped
task is stopped - regardless of Err, OK, or NotOnline |
|
| Method Summary | |
|---|---|
static AbstractTask.State |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static AbstractTask.State[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
| Methods inherited from class java.lang.Enum |
|---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Enum Constant Detail |
|---|
public static final AbstractTask.State Started
public static final AbstractTask.State Stopped
public static final AbstractTask.State Interrupted
AbstractTask.getSwingWorker(). There are a very few conditions
in which the SwingWorker can be interrupted - if it's wait()ing for example, or blocking on some other operation.
public static final AbstractTask.State OK
public static final AbstractTask.State Err
public static final AbstractTask.State Cancelled
AbstractTask.getSwingWorker().cancel() is called, this state is reached as soon
as the SwingWorker's (and TaskExecutorIF's) doInBackground method completes (is done()). This is different than
when IO operations are interrupted, which is supported by UIHookIF. The IO layer is supposed to generate
an InterruptedIOException, which gets thrown as an MBException, which the task catches as an ExecutionException, and
reports to the SimpleTaskHandlerIF as an Err.
Cancel is for the case where task is simply unaware that cancel() was called on it's SwingWorker, while it was
running the executor's doInBackground method. This is needed since Java does not support
pre-empting running threads. They pretty much have to complete, then realize that they were cancelled, and then
the results have to be thrown away (and this has to be reported to the TaskHandler).
This is different from Interruped, which can be reached only if the tread is in a state where InterruptedException
can be thrown on the SwingWorker (which might be the result of cancel(true) being called on it). The SwingWorker
will be interruptible only under a few circumstances (waiting, etc). So Cancel trumps Interrupted.
public static final AbstractTask.State NotOnline
| Method Detail |
|---|
public static AbstractTask.State[] values()
for (AbstractTask.State c : AbstractTask.State.values()) System.out.println(c);
public static AbstractTask.State valueOf(java.lang.String name)
name - the name of the enum constant to be returned.
java.lang.IllegalArgumentException - if this enum type has no constant
with the specified name
java.lang.NullPointerException - if the argument is null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||