Enum Class FutureEvent

java.lang.Object
java.lang.Enum<FutureEvent>
com.tccc.kos.commons.util.concurrent.future.FutureEvent
All Implemented Interfaces:
Serializable, Comparable<FutureEvent>, Constable

public enum FutureEvent extends Enum<FutureEvent>
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.

FutureEvent codes
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
  • Enum Constant Details

  • Method Details

    • values

      public static FutureEvent[] 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

      public static FutureEvent valueOf(String name)
      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 name
      NullPointerException - if the argument is null