Class ThreadInformation

java.lang.Object
org.jppf.management.diagnostics.ThreadInformation
All Implemented Interfaces:
Serializable

public class ThreadInformation extends Object implements Serializable
Information about a thread, including the stack trace and associated locks. This class is a serializable representation of the JDK's ThreadInfo class.
Author:
Laurent Cohen
See Also:
  • Constructor Details

    • ThreadInformation

      public ThreadInformation(ThreadInfo ti)
      Initialize this object from the specified ThreadInfo.
      Parameters:
      ti - the ThreadInfo from which to get the information.
  • Method Details

    • getId

      public long getId()
      Get the id of this thread.
      Returns:
      the id as a long.
    • getName

      public String getName()
      Get the name of this thread.
      Returns:
      the name as a string.
    • getState

      public Thread.State getState()
      Get the state of this thread.
      Returns:
      a Thread.State enum value.
    • getStackTrace

      public List<StackFrameInformation> getStackTrace()
      Get the stack trace of this thread.
      Returns:
      a list of StackFrameInformation elements, or null if no stack trace is available.
    • getOwnableSynchronizers

      public List<LockInformation> getOwnableSynchronizers()
      Get the ownable synchronizers held by this thread.
      Returns:
      a list of LockInformation, or null if this thread holds no ownable synchrnizer.
    • getWaitCount

      public long getWaitCount()
      Get the count of times this thread has been waiting.
      Returns:
      the wait count as a long.
    • getWaitTime

      public long getWaitTime()
      Get the total cumulated wait time.
      Returns:
      the wait time as a long.
    • getBlockedCount

      public long getBlockedCount()
      Get the count of times this thread has been blocked.
      Returns:
      the blocked count as a long.
    • getBlockedTime

      public long getBlockedTime()
      Get the total cumulated block time.
      Returns:
      the blocked time as a long.
    • isSuspended

      public boolean isSuspended()
      Get whether this thread is suspended.
      Returns:
      true if this thread is suspended, false otherwise.
    • isInNative

      public boolean isInNative()
      Get whether this thread is in native code.
      Returns:
      true if this thread is in native code, false otherwise.
    • getLockInformation

      public LockInformation getLockInformation()
      Get the lock this thread is waiting for, if any.
      Returns:
      a LockInformation instance, or null if this thread is not waiting on a lock.
    • getLockOwnerId

      public long getLockOwnerId()
      Get the id of the owner of the lock this thread is waiting for, if any.
      Returns:
      the owner thread id as positive long value, or -1 if this thread is not waiting on a lock.