| java.lang.Object java.lang.management.ThreadInfo
ThreadInfo | public class ThreadInfo (Code) | |
Thread information.
since: 1.5 |
Method Summary | |
public static ThreadInfo | from(CompositeData cd) Receives a
CompositeData representing a ThreadInfo
object and attempts to return the root ThreadInfo
instance.
Parameters: cd - a CompositeDate that represents aThreadInfo . | public long | getBlockedCount() Returns the number of times that the thread represented by this
ThreadInfo has been blocked on any monitor objects. | public long | getBlockedTime() If thread contention monitoring is supported and enabled, returns the
total amount of time that the thread represented by this
ThreadInfo has spent blocked on any monitor objects. | public String | getLockName() If the thread represented by this ThreadInfo is currently
blocked on or waiting on a monitor object, returns a string
representation of that monitor object.
The monitor's string representation is comprised of the following
component parts:
monitor class name
@
Integer.toHexString(System.identityHashCode(monitor))
if blocked or waiting on a monitor, a string representation ofthe monitor object. | public long | getLockOwnerId() If the thread represented by this ThreadInfo is currently
blocked on or waiting on a monitor object, returns the thread identifier
of the thread which owns the monitor.
the thread identifier of the other thread which holds the monitorthat the thread associated with this ThreadInfo isblocked or waiting on. | public String | getLockOwnerName() If the thread represented by this ThreadInfo is currently
blocked on or waiting on a monitor object, returns the name of the thread
which owns the monitor.
the name of the other thread which holds the monitor that thethread associated with this ThreadInfo is blockedor waiting on. | public StackTraceElement[] | getStackTrace() If available, returns the stack trace for the thread represented by this
ThreadInfo instance. | public long | getThreadId() Returns the thread identifier of the thread represented by this
ThreadInfo . | public String | getThreadName() Returns the name of the thread represented by this
ThreadInfo . | public Thread.State | getThreadState() Returns the thread state value of the thread represented by this
ThreadInfo . | public long | getWaitedCount() The number of times that the thread represented by this
ThreadInfo has gone to the "wait" or "timed
wait" state. | public long | getWaitedTime() If thread contention monitoring is supported and enabled, returns the
total amount of time that the thread represented by this
ThreadInfo has spent waiting for notifications. | public boolean | isInNative() Returns a boolean indication of whether or not the thread
represented by this ThreadInfo is currently in a native
method. | public boolean | isSuspended() Returns a boolean indication of whether or not the thread
represented by this ThreadInfo is currently suspended. | public String | toString() |
from | public static ThreadInfo from(CompositeData cd)(Code) | | Receives a
CompositeData representing a ThreadInfo
object and attempts to return the root ThreadInfo
instance.
Parameters: cd - a CompositeDate that represents aThreadInfo . if cd is non- null , returns a newinstance of ThreadInfo . If cd isnull , returns null . throws: IllegalArgumentException - if argument cd does not correspond to aThreadInfo with the following attributes: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 of the stackTrace array must correspond to a java.lang.StackTraceElement and have the following attributes :className (java.lang.String )methodName (java.lang.String )fileName (java.lang.String )lineNumber (java.lang.Integer )nativeMethod (java.lang.Boolean )
|
getBlockedCount | public long getBlockedCount()(Code) | | Returns the number of times that the thread represented by this
ThreadInfo has been blocked on any monitor objects. The
count is from the start of the thread's life.
the number of times the corresponding thread has been blocked ona monitor. |
getBlockedTime | public long getBlockedTime()(Code) | | If thread contention monitoring is supported and enabled, returns the
total amount of time that the thread represented by this
ThreadInfo has spent blocked on any monitor objects. The
time is measued in milliseconds and will be measured over the time period
since thread contention was most recently enabled.
if thread contention monitoring is currently enabled, the numberof milliseconds that the thread associated with thisThreadInfo has spent blocked on any monitors. Ifthread contention monitoring is supported but currently disabled,-1 . throws: UnsupportedOperationException - if the virtual machine does not support thread contentionmonitoring. See Also: ThreadMXBean.isThreadContentionMonitoringSupported See Also: ThreadMXBean.isThreadContentionMonitoringEnabled |
getLockName | public String getLockName()(Code) | | If the thread represented by this ThreadInfo is currently
blocked on or waiting on a monitor object, returns a string
representation of that monitor object.
The monitor's string representation is comprised of the following
component parts:
monitor class name
@
Integer.toHexString(System.identityHashCode(monitor))
if blocked or waiting on a monitor, a string representation ofthe monitor object. Otherwise, null . See Also: Integer.toHexString(int) See Also: System.identityHashCode(java.lang.Object) |
getLockOwnerId | public long getLockOwnerId()(Code) | | If the thread represented by this ThreadInfo is currently
blocked on or waiting on a monitor object, returns the thread identifier
of the thread which owns the monitor.
the thread identifier of the other thread which holds the monitorthat the thread associated with this ThreadInfo isblocked or waiting on. If this ThreadInfo 'sassociated thread is currently not blocked or waiting, or thereis no other thread holding the monitor, returns a -1 . |
getLockOwnerName | public String getLockOwnerName()(Code) | | If the thread represented by this ThreadInfo is currently
blocked on or waiting on a monitor object, returns the name of the thread
which owns the monitor.
the name of the other thread which holds the monitor that thethread associated with this ThreadInfo is blockedor waiting on. If this ThreadInfo 's associatedthread is currently not blocked or waiting, or there is no otherthread holding the monitor, returns a null reference. |
getStackTrace | public StackTraceElement[] getStackTrace()(Code) | | If available, returns the stack trace for the thread represented by this
ThreadInfo instance. The stack trace is returned in an
array of
StackTraceElement objects with the "top" of the
stack encapsulated in the first array element and the "bottom"
of the stack in the last array element.
If this ThreadInfo was created without any stack trace
information (e.g. by a call to
ThreadMXBean.getThreadInfo(long) )
then the returned array will have a length of zero.
the stack trace for the thread represented by thisThreadInfo . |
getThreadId | public long getThreadId()(Code) | | Returns the thread identifier of the thread represented by this
ThreadInfo .
the identifer of the thread corresponding to thisThreadInfo . |
getThreadName | public String getThreadName()(Code) | | Returns the name of the thread represented by this
ThreadInfo .
the name of the thread corresponding to thisThreadInfo . |
getThreadState | public Thread.State getThreadState()(Code) | | Returns the thread state value of the thread represented by this
ThreadInfo .
the thread state of the thread corresponding to thisThreadInfo . See Also: Thread.getState |
getWaitedCount | public long getWaitedCount()(Code) | | The number of times that the thread represented by this
ThreadInfo has gone to the "wait" or "timed
wait" state.
the numer of times the corresponding thread has been in the"wait" or "timed wait" state. |
getWaitedTime | public long getWaitedTime()(Code) | | If thread contention monitoring is supported and enabled, returns the
total amount of time that the thread represented by this
ThreadInfo has spent waiting for notifications. The time
is measued in milliseconds and will be measured over the time period
since thread contention was most recently enabled.
if thread contention monitoring is currently enabled, the numberof milliseconds that the thread associated with thisThreadInfo has spent waiting notifications. Ifthread contention monitoring is supported but currently disabled,-1 . throws: UnsupportedOperationException - if the virtual machine does not support thread contentionmonitoring. See Also: ThreadMXBean.isThreadContentionMonitoringSupported See Also: ThreadMXBean.isThreadContentionMonitoringEnabled |
isInNative | public boolean isInNative()(Code) | | Returns a boolean indication of whether or not the thread
represented by this ThreadInfo is currently in a native
method.
if the corresponding thread is executing a native methodthen true , otherwise false . |
isSuspended | public boolean isSuspended()(Code) | | Returns a boolean indication of whether or not the thread
represented by this ThreadInfo is currently suspended.
if the corresponding thread is suspened thentrue , otherwise false . |
|
|