Package com.jprofiler.api.probe.embedded
Enum ThreadState
- java.lang.Object
-
- java.lang.Enum<ThreadState>
-
- com.jprofiler.api.probe.embedded.ThreadState
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<ThreadState>
public enum ThreadState extends java.lang.Enum<ThreadState>
Allows you to override the thread state recorded in JProfiler.You can nest calls to
enter()andexit(), but only the outermost call is used for recording.It is very important that a matching
exit()is always called, so the exit call must be put it a finally block like this:ThreadState.NETIO.enter(); try { // your code } finally { ThreadState.exit(); }
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidenter()Enters a thread state.static voidexit()Exists the current override state and resets the state to the value reported by the JVM.static ThreadStatevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static ThreadState[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
RUNNABLE
public static final ThreadState RUNNABLE
The current thread is runnable.
-
WAITING
public static final ThreadState WAITING
The current thread is waiting.
-
BLOCKED
public static final ThreadState BLOCKED
The current thread is blocked on a monitor.
-
NETIO
public static final ThreadState NETIO
The current thread is in a Net IO operation.
-
-
Method Detail
-
values
public static ThreadState[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ThreadState c : ThreadState.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ThreadState valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
enter
public void enter()
Enters a thread state. This state will be recorded until the matching exit is called.
-
exit
public static void exit()
Exists the current override state and resets the state to the value reported by the JVM.
-
-