|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface representing a snapshot of a thread's state at a given time. Note that when this object is created, the thread and state it represents may have died and been garbage collected already.
Nested Class Summary | |
static interface |
ThreadSnapshot.Monitor
Interface representing a monitor from a specific thread snapshot. |
Field Summary | |
static int |
THREAD_STATE_ACTIVE
Thread state for an active thread. |
static int |
THREAD_STATE_IO
Thread state for a thread waiting for IO. |
static int |
THREAD_STATE_LOCKED
Thread state for a thread blocked trying to take a lock. |
static int |
THREAD_STATE_SUSPENDED
Thread state for a suspended thread. |
static int |
THREAD_STATE_WAITING
Thread state for a thread waiting on notification. |
Method Summary | |
ThreadSnapshot.Monitor |
getBlockedOnMonitor()
Return the monitor this thread is blocked on, or null if none. |
java.lang.String |
getDescription()
Returns the snapshot as a String. |
int |
getID()
Returns the id of the thread that the snapshot was created for. |
java.lang.String |
getName()
Returns the name of the thread that this snapshot was created from. |
int |
getPriority()
Returns the priority level of the thread at the time of the snapshot. |
java.util.List |
getStackTrace()
Returns a list of CallTraceElement. |
int |
getState()
Returns the thread state (or as close as we can describe using the THREAD_STATE_ constants). |
ThreadSnapshot.Monitor |
getWaitingOnMonitor()
Return the monitor this thread is waiting on, or null if none. |
boolean |
isDaemon()
Returns true if this thread is a daemon thread. |
Field Detail |
public static final int THREAD_STATE_ACTIVE
public static final int THREAD_STATE_IO
public static final int THREAD_STATE_WAITING
public static final int THREAD_STATE_LOCKED
public static final int THREAD_STATE_SUSPENDED
Method Detail |
public java.lang.String getName()
public java.lang.String getDescription()
getDescription
in interface Describable
Describable.getDescription()
public int getState()
THREAD_STATE_ACTIVE
,
THREAD_STATE_IO
,
THREAD_STATE_WAITING
,
THREAD_STATE_LOCKED
,
THREAD_STATE_SUSPENDED
public int getID()
public boolean isDaemon()
public int getPriority()
public java.util.List getStackTrace()
CallTraceElement
public ThreadSnapshot.Monitor getBlockedOnMonitor()
public ThreadSnapshot.Monitor getWaitingOnMonitor()
Object.wait()
on a monitor, the
thread is said to be "waiting" on this monitor. If this is the case,
this method return the monitor the thread is waiting on.
Note that the thread needs to take the monitor before being able to
wait on it, but that the monitor is actually released before waiting
on it. Therefore, if this method returns non-null, then the
corresponding monitor will also be returned by a call to
CallTraceElement.getMonitors()
for one stack trace element,
however, this monitor is currently not held by the thread,
for this reason.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |