Enum Class ThreadContext
- All Implemented Interfaces:
Serializable, Comparable<ThreadContext>, Constable
Describes the current execution context for platform thread checks.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionPlatform event-loop thread.Main server thread.Network I/O thread.Unknown or unclassified thread.Generic worker or async thread. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true when blocking operations should be avoided.static ThreadContextReturns the enum constant of this class with the specified name.static ThreadContext[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MAIN
Main server thread. -
EVENT_LOOP
Platform event-loop thread. -
NETWORK
Network I/O thread. -
WORKER
Generic worker or async thread. -
UNKNOWN
Unknown or unclassified thread.
-
-
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
-
isBlockingSensitive
public boolean isBlockingSensitive()Returns true when blocking operations should be avoided.- Returns:
- true if blocking work is unsafe
-