java.lang.management.ThreadInfoThis thread information class is designed for use in monitoring of the system, not for synchronization control.
| Method Summary | ||
static ThreadInfo |
from(javax.management.openmbean.CompositeData cd) Returns a ThreadInfo object represented by the
given CompositeData. |
|
long |
getBlockedCount() Returns the total number of times that
the thread associated with this ThreadInfo
blocked to enter or reenter a monitor. |
|
long |
getBlockedTime() Returns the approximate accumulated elapsed time (in milliseconds)
that the thread associated with this ThreadInfo
has blocked to enter or reenter a monitor
since thread contention monitoring is enabled. |
|
| getLockedMonitors() Returns an array of MonitorInfo objects, each of which
represents an object monitor currently locked by the thread
associated with this ThreadInfo. |
||
LockInfo[] |
getLockedSynchronizers() Returns an array of LockInfo objects, each of which
represents an ownable
synchronizer currently locked by the thread associated with
this ThreadInfo. |
|
| getLockInfo() Returns the LockInfo of an object for which
the thread associated with this ThreadInfo
is blocked waiting. |
||
| getLockName() Returns the string representation
of an object for which the thread associated with this
ThreadInfo is blocked waiting. |
||
long |
getLockOwnerId() Returns the ID of the thread which owns the object
for which the thread associated with this ThreadInfo
is blocked waiting. |
|
| getLockOwnerName() Returns the name of the thread which owns the object
for which the thread associated with this ThreadInfo
is blocked waiting. |
||
| getStackTrace() Returns the stack trace of the thread
associated with this ThreadInfo. |
||
long |
getThreadId() Returns the ID of the thread associated with this ThreadInfo. |
|
| getThreadName() Returns the name of the thread associated with this ThreadInfo. |
||
| getThreadState() Returns the state of the thread associated with this ThreadInfo. |
||
long |
getWaitedCount() Returns the total number of times that
the thread associated with this ThreadInfo
waited for notification. |
|
long |
getWaitedTime() Returns the approximate accumulated elapsed time (in milliseconds)
that the thread associated with this ThreadInfo
has waited for notification
since thread contention monitoring is enabled. |
|
boolean |
isInNative() Tests if the thread associated with this ThreadInfo
is executing native code via the Java Native Interface (JNI). |
|
boolean |
isSuspended() Tests if the thread associated with this ThreadInfo
is suspended. |
|
| toString() Returns a string representation of this thread info. |
||
| Methods inherited from class java.lang.Object |
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
The Java virtual machine may measure the time with a high resolution timer. This statistic is reset when the thread contention monitoring is reenabled.
The Java virtual machine may measure the time with a high resolution timer. This statistic is reset when the thread contention monitoring is reenabled.
This method returns null if the thread is not in any of the above conditions.
getLockInfo().toString()
This method will return null if this thread is not blocked waiting for any object or if the object is not owned by any thread.
Some Java virtual machines may, under some circumstances, omit one or more stack frames from the stack trace. In the extreme case, a virtual machine that has no stack trace information concerning the thread associated with this ThreadInfo is permitted to return a zero-length array from this method.
Attribute Name Type threadId java.lang.Long threadName java.lang.String threadState java.lang.String suspended java.lang.Boolean inNative java.lang.Boolean blockedCount java.lang.Long blockedTime java.lang.Long waitedCount java.lang.Long waitedTime java.lang.Long lockInfo javax.management.openmbean.CompositeData - the mapped type for LockInfo as specified in the type mapping rules of MXBeans. If cd does not contain this attribute, the LockInfo object will be constructed from the value of the lockName attribute.
lockName java.lang.String lockOwnerId java.lang.Long lockOwnerName java.lang.String stackTrace javax.management.openmbean.CompositeData[] Each element is a CompositeData representing StackTraceElement containing the following attributes:
Attribute Name Type className java.lang.String methodName java.lang.String fileName java.lang.String lineNumber java.lang.Integer nativeMethod java.lang.Boolean lockedMonitors javax.management.openmbean.CompositeData[] whose element type is the mapped type for MonitorInfo as specified in the Monitor.from method. If cd does not contain this attribute, this attribute will be set to an empty array.
lockedSynchronizers javax.management.openmbean.CompositeData[] whose element type is the mapped type for LockInfo as specified in the type mapping rules of MXBeans. If cd does not contain this attribute, this attribute will be set to an empty array.