Package org.jppf.management.diagnostics
Class ThreadInformation
java.lang.Object
org.jppf.management.diagnostics.ThreadInformation
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongGet the count of times this thread has been blocked.longGet the total cumulated block time.longgetId()Get the id of this thread.Get the lock this thread is waiting for, if any.longGet the id of the owner of the lock this thread is waiting for, if any.getName()Get the name of this thread.Get the ownable synchronizers held by this thread.Get the stack trace of this thread.getState()Get the state of this thread.longGet the count of times this thread has been waiting.longGet the total cumulated wait time.booleanGet whether this thread is in native code.booleanGet whether this thread is suspended.
-
Constructor Details
-
ThreadInformation
Initialize this object from the specifiedThreadInfo.- Parameters:
ti- theThreadInfofrom which to get the information.
-
-
Method Details
-
getId
public long getId()Get the id of this thread.- Returns:
- the id as a long.
-
getName
Get the name of this thread.- Returns:
- the name as a string.
-
getState
Get the state of this thread.- Returns:
- a
Thread.Stateenum value.
-
getStackTrace
Get the stack trace of this thread.- Returns:
- a list of
StackFrameInformationelements, ornullif no stack trace is available.
-
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:
trueif this thread is suspended,falseotherwise.
-
isInNative
public boolean isInNative()Get whether this thread is in native code.- Returns:
trueif this thread is in native code,falseotherwise.
-
getLockInformation
Get the lock this thread is waiting for, if any.- Returns:
- a
LockInformationinstance, ornullif 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.
-