com.ibm.dtfj.java
Interface JavaThread


public interface JavaThread

Represents a Java thread

See Also:
JavaRuntime.getThreads()

Field Summary
static int STATE_ALIVE
           
static int STATE_BLOCKED_ON_MONITOR_ENTER
           
static int STATE_IN_NATIVE
           
static int STATE_IN_OBJECT_WAIT
           
static int STATE_INTERRUPTED
           
static int STATE_PARKED
           
static int STATE_RUNNABLE
           
static int STATE_SLEEPING
           
static int STATE_SUSPENDED
           
static int STATE_TERMINATED
           
static int STATE_VENDOR_1
           
static int STATE_VENDOR_2
           
static int STATE_VENDOR_3
           
static int STATE_WAITING
           
static int STATE_WAITING_INDEFINITELY
           
static int STATE_WAITING_WITH_TIMEOUT
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 ImageThread getImageThread()
           
 ImagePointer getJNIEnv()
           
 java.lang.String getName()
          Return the name of the thread.
 JavaObject getObject()
          Fetch the java.lang.Thread associated with this thread.
 int getPriority()
           
 java.util.Iterator getStackFrames()
           
 java.util.Iterator getStackSections()
           
 int getState()
           
 int hashCode()
           
 

Field Detail

STATE_ALIVE

static final int STATE_ALIVE
See Also:
Constant Field Values

STATE_TERMINATED

static final int STATE_TERMINATED
See Also:
Constant Field Values

STATE_RUNNABLE

static final int STATE_RUNNABLE
See Also:
Constant Field Values

STATE_WAITING_INDEFINITELY

static final int STATE_WAITING_INDEFINITELY
See Also:
Constant Field Values

STATE_WAITING_WITH_TIMEOUT

static final int STATE_WAITING_WITH_TIMEOUT
See Also:
Constant Field Values

STATE_SLEEPING

static final int STATE_SLEEPING
See Also:
Constant Field Values

STATE_WAITING

static final int STATE_WAITING
See Also:
Constant Field Values

STATE_IN_OBJECT_WAIT

static final int STATE_IN_OBJECT_WAIT
See Also:
Constant Field Values

STATE_PARKED

static final int STATE_PARKED
See Also:
Constant Field Values

STATE_BLOCKED_ON_MONITOR_ENTER

static final int STATE_BLOCKED_ON_MONITOR_ENTER
See Also:
Constant Field Values

STATE_SUSPENDED

static final int STATE_SUSPENDED
See Also:
Constant Field Values

STATE_INTERRUPTED

static final int STATE_INTERRUPTED
See Also:
Constant Field Values

STATE_IN_NATIVE

static final int STATE_IN_NATIVE
See Also:
Constant Field Values

STATE_VENDOR_1

static final int STATE_VENDOR_1
See Also:
Constant Field Values

STATE_VENDOR_2

static final int STATE_VENDOR_2
See Also:
Constant Field Values

STATE_VENDOR_3

static final int STATE_VENDOR_3
See Also:
Constant Field Values
Method Detail

getJNIEnv

ImagePointer getJNIEnv()
                       throws CorruptDataException
Returns:
the address of the JNIEnv struct which represnts this thread instance in JNI
Throws:
CorruptDataException

getPriority

int getPriority()
                throws CorruptDataException
Returns:
the Java priority of the thread (a number between 1 and 10 inclusive)
Throws:
CorruptDataException
See Also:
Thread.getPriority()

getObject

JavaObject getObject()
                     throws CorruptDataException
Fetch the java.lang.Thread associated with this thread. If the thread is in the process of being attached, this may return null.

Returns:
the a JavaObject representing the java.lang.Thread associated with this thread
Throws:
CorruptDataException
See Also:
JavaObject, Thread

getState

int getState()
             throws CorruptDataException
Returns:
the state of the thread when the image was created. The result is a bit vector, and uses the states defined by the JVMTI specification.
Throws:
CorruptDataException
See Also:
JVMTI specification

getImageThread

ImageThread getImageThread()
                           throws CorruptDataException
Returns:
the ImageThread which this ManagedThread is currently bound to.
Throws:
CorruptDataException
See Also:
ImageThread

getStackSections

java.util.Iterator getStackSections()
Returns:
a collection of ImageSections which make up the managed stack.

Some Runtime implementations may also use parts of the ImageThread's stack for ManagesStackFrames

See Also:
ImageSection, ImageThread.getStackSections(), CorruptData

getStackFrames

java.util.Iterator getStackFrames()
Returns:
an iterator to walk the managed stack frames in order from top-of-stack (i.e. most recent frame) to bottom-of-stack
See Also:
JavaStackFrame, CorruptData

getName

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) DTFJ will synthesize a name for the thread.

Returns:
the name of the thread
Throws:
CorruptDataException

equals

boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
Parameters:
obj -
Returns:
True obj refers to the same Java Thread in the image

hashCode

int hashCode()
Overrides:
hashCode in class java.lang.Object