Enum Class Worker.State

java.lang.Object
java.lang.Enum<Worker.State>
javafx.concurrent.Worker.State
All Implemented Interfaces:
Serializable, Comparable<Worker.State>, Constable
Enclosing interface:
Worker<V>

public static enum Worker.State extends Enum<Worker.State>

The state of a Worker. The state transitions in a Worker are very well defined. All Workers begin in the READY state. In some circumstances, a Worker might be scheduled for execution before it is actually executed. In such cases, it is sometimes useful to know when the Worker has been SCHEDULED separately from when it is RUNNING. However even in cases where the Worker is executed immediately, the Worker will temporarily enter the SCHEDULED state before entering the RUNNING state. That is, the transition is always from READY to SCHEDULED to RUNNING (unless of course the Worker in cancelled).

A Worker which runs but is never cancelled can only end up in one of two states, either SUCCEEDED or FAILED. It only enters FAILED if an exception was thrown during the execution of the Worker. A Worker may be cancelled when READY, SCHEDULED, or RUNNING, in which case the final status will be CANCELLED. When a Worker is cancelled in one of these circumstances it will transition immediately to the CANCELLED state.

A reusable Worker will transition from CANCELLED, SUCCEEDED or FAILED back to READY. From that point the normal state transitions are again followed.

Since:
JavaFX 2.0