|
Préférences
Moteurs de recherche
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
JavaTM 2 Platform Std. Ed. v1.5.0
java.lang.management
|
Method Summary | |
---|---|
static ThreadInfo |
from(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. |
String |
getLockName()
Returns the string representation of the monitor lock that the thread associated with this ThreadInfo is blocked to enter or waiting to be notified through the Object.wait method. |
long |
getLockOwnerId()
Returns the ID of the thread which holds the monitor lock of an object on which the thread associated with this ThreadInfo is blocking. |
String |
getLockOwnerName()
Returns the name of the thread which holds the monitor lock of an object on which the thread associated with this ThreadInfo is blocking. |
StackTraceElement[] |
getStackTrace()
Returns the stack trace of the thread associated with this ThreadInfo. |
long |
getThreadId()
Returns the ID of the thread associated with this ThreadInfo. |
String |
getThreadName()
Returns the name of the thread associated with this ThreadInfo. |
Thread.State |
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. |
String |
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 |
Method Detail |
---|
public long getThreadId()
public String getThreadName()
public Thread.State getThreadState()
public long getBlockedTime()
BLOCKED
state since thread
contention monitoring was last enabled.
This method returns -1 if thread contention monitoring
is disabled.
The Java virtual machine may measure the time with a high resolution timer. This statistic is reset when the thread contention monitoring is reenabled.
UnsupportedOperationException
- if the Java
virtual machine does not support this operation.ThreadMXBean.isThreadContentionMonitoringSupported()
,
ThreadMXBean.setThreadContentionMonitoringEnabled(boolean)
public long getBlockedCount()
BLOCKED
state.
public long getWaitedTime()
WAITING
or TIMED_WAITING
state
since thread contention monitoring is enabled.
This method returns -1 if thread contention monitoring
is disabled.
The Java virtual machine may measure the time with a high resolution timer. This statistic is reset when the thread contention monitoring is reenabled.
UnsupportedOperationException
- if the Java
virtual machine does not support this operation.ThreadMXBean.isThreadContentionMonitoringSupported()
,
ThreadMXBean.setThreadContentionMonitoringEnabled(boolean)
public long getWaitedCount()
WAITING
or TIMED_WAITING
state.
public String getLockName()
Object.wait
method.
The returned string representation of a monitor lock consists of
the name of the class of which the object is an instance, the
at-sign character `@', and the unsigned hexadecimal representation
of the identity hash code of the object.
The returned string may not
be unique depending on the implementation of the
System.identityHashCode(java.lang.Object)
method.
This method returns a string equals to the value of:
where lock is the monitor lock object.lock.getClass().getName() + '@' + Integer.toHexString(System.identityHashCode(lock))
If the thread is not blocking to enter on any monitor object, or is not waiting on a monitor object for notification in a Object.wait call, this method returns null.
public long getLockOwnerId()
getLockName()
public String getLockOwnerName()
getLockName()
public StackTraceElement[] getStackTrace()
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.
public boolean isSuspended()
Thread.suspend()
has been called.
public boolean isInNative()
public String toString()
public static ThreadInfo from(CompositeData cd)
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 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
cd
- CompositeData representing a ThreadInfo
IllegalArgumentException
- if cd does not
represent a ThreadInfo with the attributes described
above.