Enum Class FutureEvent
- All Implemented Interfaces:
Serializable
,Comparable<FutureEvent>
,Constable
Types of
FutureWork
callback events. The various events cascade,
making it easier to add a handler to a single event (as opposed to multiple events).
Be aware that FINISHED is generally reserved for special logic such
as chaining work together. This event assumes that all user callbacks have
been completed, and all work related to the future is finished, so that
other futures may safely consider this future and all related callbacks done.
Using this event to do other work can result in race conditions that are very
hard to debug.
START | : | called before the FutureWork 's Runnable method is executed |
SUCCESS | : | called from FutureWork.success() |
FAIL | : | called from FutureWork.fail() |
CANCEL | : | called from FutureWork.cancel() |
ABORT | : | called from FutureWork.abort() |
DONE | : | called after the SUCCESS or FAIL callbacks |
TERMINATE | : | called after the CANCEL or ABORT callbacks |
COMPLETE | : | called after the DONE or TERMINATE callbacks |
FINISHED | : | called after the COMPLETE callbacks |
INTERRUPT | : | called on cancel or abort if the process was still running |
Visually:
START |---> SUCCESS ---> DONE ---> COMPLETE ---> FINISHED |---> FAIL ^ ^ |---> CANCEL ---> TERMINATE ^ |---> ABORT ^
- Since:
- 1.0
- Version:
- 2022-05-01
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic FutureEvent
Returns the enum constant of this class with the specified name.static FutureEvent[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
START
-
SUCCESS
-
FAIL
-
CANCEL
-
ABORT
-
DONE
-
TERMINATE
-
COMPLETE
-
FINISHED
-
INTERRUPT
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- 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 nameNullPointerException
- if the argument is null
-