Enum Class Worker.State
- All Implemented Interfaces:
-
Serializable,Comparable<Worker.State>,Constable
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
Nested Class Summary
Nested classes/interfaces declared in class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Enum Constant Summary
| Enum Constant | Description |
|---|---|
CANCELLED |
Indicates that this Worker has been cancelled via the Worker.cancel() method. |
FAILED |
Indicates that this Worker has failed, usually due to some unexpected condition having occurred. |
READY |
Indicates that the Worker has not yet been executed and is ready to be executed, or that it has been reinitialized. |
RUNNING |
Indicates that this Worker is running. |
SCHEDULED |
Indicates that the Worker has been scheduled for execution, but that it is not currently running. |
SUCCEEDED |
Indicates that this Worker has completed successfully, and that there is a valid result ready to be read from the value property. |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
static Worker.State |
valueOf |
Returns the enum constant of this class with the specified name. |
static Worker.State[] |
values() |
Returns an array containing the constants of this enum class, in the order they are declared. |
Enum Constant Details
READY
public static final Worker.State READY
SCHEDULED
public static final Worker.State SCHEDULED
RUNNING
public static final Worker.State RUNNING
SUCCEEDED
public static final Worker.State SUCCEEDED
value property.CANCELLED
public static final Worker.State CANCELLED
Worker.cancel() method.FAILED
public static final Worker.State FAILED
exception property.Method Details
values
public static Worker.State[] values()
- Returns:
- an array containing the constants of this enum class, in the order they are declared
valueOf
public static Worker.State valueOf(String name)
- Parameters:
-
name- the name of the enum constant to be returned. - Returns:
- the enum constant with the specified name
- Throws:
-
IllegalArgumentException- if this enum class has no constant with the specified name -
NullPointerException- if the argument is null
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.