|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface JavaThread
Represents a Java thread.
JavaThread
instances correspond with executing threads in the Java Virtual Machine,
not Thread
instances on the heap.
JavaThread
provide information on what was running including the locations
of all of the threads within the Java program when the dump was taken.
JavaRuntime.getThreads()
Field Summary | |
---|---|
static int |
STATE_ALIVE
The thread is alive |
static int |
STATE_BLOCKED_ON_MONITOR_ENTER
The thread is waiting to enter an object monitor |
static int |
STATE_IN_NATIVE
The thread is in native code |
static int |
STATE_IN_OBJECT_WAIT
The thread is in Object.wait |
static int |
STATE_INTERRUPTED
The thread has a pending interrupt |
static int |
STATE_PARKED
The thread has been deliberately removed from scheduling |
static int |
STATE_RUNNABLE
The thread can be run although may not be actually running |
static int |
STATE_SLEEPING
The thread is in the Thread.sleep method |
static int |
STATE_SUSPENDED
The thread has been suspended by Thread.suspend |
static int |
STATE_TERMINATED
The thread has terminated |
static int |
STATE_VENDOR_1
The thread is in a vendor specific state |
static int |
STATE_VENDOR_2
The thread is in a vendor specific state |
static int |
STATE_VENDOR_3
The thread is in a vendor specific state |
static int |
STATE_WAITING
The thread is in a waiting state in native code |
static int |
STATE_WAITING_INDEFINITELY
The thread is waiting on a monitor with no timeout value set |
static int |
STATE_WAITING_WITH_TIMEOUT
The thread is waiting on a monitor but will timeout at some point |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
ImageThread |
getImageThread()
Returns the operating system level thread that executes the Java thread. |
ImagePointer |
getJNIEnv()
Get the address of the JNIEnv structure which represents this thread instance in JNI. |
java.lang.String |
getName()
Return the name of the thread. |
JavaObject |
getObject()
Returns the JavaObject representing the instance of the class or subclass of Thread
that represents this thread in the Java Virtual Machine. |
int |
getPriority()
Get the Java priority of the thread. |
java.util.List<JavaStackFrame> |
getStackFrames()
Get the set of stack frames. |
java.util.List<ImageSection> |
getStackSections()
Get the List of ImageSections which make up the Java Virtual Machine stack. |
int |
getState()
Get the state of the thread when the dump was generated. |
int |
hashCode()
|
Field Detail |
---|
static final int STATE_ALIVE
static final int STATE_TERMINATED
static final int STATE_RUNNABLE
static final int STATE_WAITING_INDEFINITELY
static final int STATE_WAITING_WITH_TIMEOUT
static final int STATE_SLEEPING
static final int STATE_WAITING
static final int STATE_IN_OBJECT_WAIT
static final int STATE_PARKED
static final int STATE_BLOCKED_ON_MONITOR_ENTER
static final int STATE_SUSPENDED
static final int STATE_INTERRUPTED
static final int STATE_IN_NATIVE
static final int STATE_VENDOR_1
static final int STATE_VENDOR_2
static final int STATE_VENDOR_3
Method Detail |
---|
ImagePointer getJNIEnv() throws CorruptDataException
Get the address of the JNIEnv structure which represents this thread instance in JNI.
CorruptDataException
int getPriority() throws CorruptDataException
Get the Java priority of the thread.
The value returned will be the same as what would have been returned by a call
to Thread.getPriority()
within the Java Virtual Machine.
CorruptDataException
Thread.getPriority()
JavaObject getObject() throws CorruptDataException
Returns the JavaObject
representing the instance of the class or subclass of Thread
that represents this thread in the Java Virtual Machine.
The object returned is the Thread
instance the method
start()
was executed against in order to create this
Java thread.
This method may return null
when there is no Thread
instance associated with this
Java thread. Some Java threads may be created for purposes other than for executing Java code
(for example, for garbage collection).
Thread
associated with this thread, or null
.
CorruptDataException
- if the reference to java.lang.Thread
is not null
and cannot be retrieved.JavaObject
,
Thread
int getState() throws CorruptDataException
Get the state of the thread when the dump was generated.
The result is a bit vector, and uses the states defined by the function GetThreadState in the JVMTI specification.
CorruptDataException
- If the thread state could not be successfully retrieved.ImageThread getImageThread() throws CorruptDataException, DataUnavailable
Returns the operating system level thread that executes the Java thread.
This will return an ImageThread
if an operating system level thread can be
returned, otherwise the DataUnavailable
exception is thrown.
There is no guarantee that there is a 1:1 relationship between JavaThreads
and ImageThreads
.
CorruptDataException
- If the underlying resource describing the native representation of the thread
is damaged.
DataUnavailable
- If no mapping is provided due to missing or limited underlying resources.ImageThread
java.util.List<ImageSection> getStackSections()
Get the List of ImageSections
which make up the Java Virtual Machine stack.
Some Java Virtual Machine implementations may use parts of the ImageThread's stack for JavaStackFrames.
ImageSections
which make up the Java stack.ImageSection
,
ImageThread.getStackSections()
,
CorruptData
java.util.List<JavaStackFrame> getStackFrames()
Get the set of stack frames.
The start of the list will contain the top most stack frame, the last entry will contain the bottom most stack frame. The top contains the most recently executing stack frame.
This method may return an empty list when there are no Java stack frames associated with
this Java thread. null
must never be returned.
JavaStackFrame
java.lang.String getName() throws CorruptDataException
Return the name of the thread.
Usually this is derived from the object associated with the thread, but if the name cannot be derived this way (e.g. there is no object associated with the thread) a name will be created for the thread.
CorruptDataException
- If a name exists but cannot be retrieved.boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
-
int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |