Enum Class ThreadState

java.lang.Object
java.lang.Enum<ThreadState>
com.jprofiler.api.probe.injected.ThreadState
All Implemented Interfaces:
Serializable, Comparable<ThreadState>, Constable

public enum ThreadState extends Enum<ThreadState>
Allows you to override the thread state recorded in JProfiler.

You can nest calls to enter() and exit(), but only the outmost call is used for recording.

It is very important that a matching exit() is always called, so if you call enter() in an Interception with with Interception.invokeOn() set to InvocationType.ENTER, you must always define a method right below it that is annotated with AdditionalInterception with AdditionalInterception.value() set to InvocationType.EXIT where you call exit().

  • Enum Constant Details

    • 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 Details

    • values

      public static ThreadState[] 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 ThreadState 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
    • 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.