com.ibm.dtfj.java

Interface JavaThread


  1. public interface JavaThread
Represents a Java thread.
See Also:
JavaRuntime.getThreads()

Field Summary

Modifier and Type Field and Description
  1. static
  2. int
STATE_ALIVE
The thread is alive
  1. static
  2. int
STATE_BLOCKED_ON_MONITOR_ENTER
The thread is waiting to enter an object monitor
  1. static
  2. int
STATE_IN_NATIVE
The thread is in native code
  1. static
  2. int
STATE_IN_OBJECT_WAIT
The thread is in Object.wait
  1. static
  2. int
STATE_INTERRUPTED
The thread has a pending interrupt
  1. static
  2. int
STATE_PARKED
The thread has been deliberately removed from scheduling
  1. static
  2. int
STATE_RUNNABLE
The thread can be run although may not be actually running
  1. static
  2. int
STATE_SLEEPING
The thread is in the Thread.sleep method
  1. static
  2. int
STATE_SUSPENDED
The thread has been suspended by Thread.suspend
  1. static
  2. int
STATE_TERMINATED
The thread has terminated
  1. static
  2. int
STATE_VENDOR_1
The thread is in a vendor specific state
  1. static
  2. int
STATE_VENDOR_2
The thread is in a vendor specific state
  1. static
  2. int
STATE_VENDOR_3
The thread is in a vendor specific state
  1. static
  2. int
STATE_WAITING
The thread is in a waiting state in native code
  1. static
  2. int
STATE_WAITING_INDEFINITELY
The thread is waiting on a monitor with no timeout value set
  1. static
  2. int
STATE_WAITING_WITH_TIMEOUT
The thread is waiting on a monitor but will timeout at some point

Method Summary

Modifier and Type Method and Description
  1. boolean
equals(java.lang.Object obj)
  1. JavaObject
getBlockingObject()
For threads that are in STATE_BLOCKED_ON_MONITOR_ENTER this method returns the JavaObject who's monitor they are blocked on.
  1. ImageThread
getImageThread()
Represents the joining point between the Java view of execution and the corresponding native view.
  1. ImagePointer
getJNIEnv()
Get the address of the JNIEnv structure which represents this thread instance in JNI.
  1. java.lang.String
getName()
Return the name of the thread.
  1. JavaObject
getObject()
Fetch the java.lang.Thread associated with this thread.
  1. int
getPriority()
Get the Java priority of the thread.
  1. java.util.Iterator
getStackFrames()
Get the set of stack frames.
  1. java.util.Iterator
getStackSections()
Get the set of ImageSections which make up the managed stack.
  1. int
getState()
Get the state of the thread when the image was created.
  1. int
hashCode()

Field Detail

STATE_ALIVE

  1. static final int STATE_ALIVE
The thread is alive
See Also:

STATE_TERMINATED

  1. static final int STATE_TERMINATED
The thread has terminated
See Also:

STATE_RUNNABLE

  1. static final int STATE_RUNNABLE
The thread can be run although may not be actually running
See Also:

STATE_WAITING_INDEFINITELY

  1. static final int STATE_WAITING_INDEFINITELY
The thread is waiting on a monitor with no timeout value set
See Also:

STATE_WAITING_WITH_TIMEOUT

  1. static final int STATE_WAITING_WITH_TIMEOUT
The thread is waiting on a monitor but will timeout at some point
See Also:

STATE_SLEEPING

  1. static final int STATE_SLEEPING
The thread is in the Thread.sleep method
See Also:

STATE_WAITING

  1. static final int STATE_WAITING
The thread is in a waiting state in native code
See Also:

STATE_IN_OBJECT_WAIT

  1. static final int STATE_IN_OBJECT_WAIT
The thread is in Object.wait
See Also:

STATE_PARKED

  1. static final int STATE_PARKED
The thread has been deliberately removed from scheduling
See Also:

STATE_BLOCKED_ON_MONITOR_ENTER

  1. static final int STATE_BLOCKED_ON_MONITOR_ENTER
The thread is waiting to enter an object monitor
See Also:

STATE_SUSPENDED

  1. static final int STATE_SUSPENDED
The thread has been suspended by Thread.suspend
See Also:

STATE_INTERRUPTED

  1. static final int STATE_INTERRUPTED
The thread has a pending interrupt
See Also:

STATE_IN_NATIVE

  1. static final int STATE_IN_NATIVE
The thread is in native code
See Also:

STATE_VENDOR_1

  1. static final int STATE_VENDOR_1
The thread is in a vendor specific state
See Also:

STATE_VENDOR_2

  1. static final int STATE_VENDOR_2
The thread is in a vendor specific state
See Also:

STATE_VENDOR_3

  1. static final int STATE_VENDOR_3
The thread is in a vendor specific state
See Also:

Method Detail

getJNIEnv

  1. ImagePointer getJNIEnv()
  2. throws CorruptDataException
Get the address of the JNIEnv structure which represents this thread instance in JNI.
Returns:
the address of the JNIEnv structure which represents this thread instance in JNI
Throws:

getPriority

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

getObject

  1. JavaObject getObject()
  2. 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:
See Also:
JavaObject, Thread

getState

  1. int getState()
  2. throws CorruptDataException
Get the state of the thread when the image was created.
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:

getImageThread

  1. ImageThread getImageThread()
  2. throws CorruptDataException
  3. DataUnavailable
Represents the joining point between the Java view of execution and the corresponding native view. This method is where the mapping from Java into native threading resources is provided.
Returns:
the ImageThread which this ManagedThread is currently bound to.
Throws:
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 (this exception added in DTFJ 1.1)
See Also:

getStackSections

  1. java.util.Iterator getStackSections( )
Get the set of ImageSections which make up the managed stack.
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:

getStackFrames

  1. java.util.Iterator getStackFrames( )
Get the set of stack frames.
Returns:
an iterator to walk the managed stack frames in order from top-of-stack (that is, the most recent frame) to bottom-of-stack
See Also:

getName

  1. java.lang.String getName()
  2. 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:

getBlockingObject

  1. JavaObject getBlockingObject()
  2. throws CorruptDataException
  3. DataUnavailable
For threads that are in STATE_BLOCKED_ON_MONITOR_ENTER this method returns the JavaObject who's monitor they are blocked on. For threads that are in STATE_IN_OBJECT_WAIT this method returns the JavaObject that Object.wait() was called on. For threads that are in STATE_PARKED this method returns the JavaObject that was passed as the "blocker" object to the java.util.concurrent.LockSupport.park() call. It may return null if no blocker object was passed. For threads in any other state this call will return null. The state of the thread can be determined by calling JavaThread.getState()
Returns:
the object this thread is waiting on or null.
Throws:
Since:
1.6

equals

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

hashCode

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