Enum Class ThreadStatus
- All Implemented Interfaces:
Serializable
,Comparable<ThreadStatus>
,Constable
Represents all supported thread statuses.
These constants are used as parameters in various Connection
methods.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetName()
Returns a verbose description of the thread status.toString()
static ThreadStatus
Returns the enum constant of this class with the specified name.static ThreadStatus[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ALL
All thread statuses. -
RUNNING
Only when the thread is running. More precisely if the thread is eligible to run, including the times when the scheduler of the operating system does not allocate CPU time to the thread. -
SLEEPING
Only when the thread is sleeping. This happens when a thread callsObject.wait()
or uses corresponding facilities ofjava.util.concurrent
. -
BLOCKING
Only when the thread is blocking. This happens when a thread tries to enter a contendedsynchronized
method or block or uses corresponding facilities ofjava.util.concurrent
. -
NET_IO
Only when the thread is waiting for the network to accept or deliver data.
-
-
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
-
getName
Returns a verbose description of the thread status.- Returns:
- the verbose description
-
toString
- Overrides:
toString
in classEnum<ThreadStatus>
-