Class JCJavaThread

java.lang.Object
com.ibm.dtfj.java.javacore.JCJavaThread
All Implemented Interfaces:
JavaThread

public class JCJavaThread extends Object implements JavaThread
  • Constructor Details

  • Method Details

    • getImageThread

      public ImageThread getImageThread() throws CorruptDataException, DataUnavailable
      Description copied from interface: JavaThread
      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.
      Specified by:
      getImageThread in interface JavaThread
      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:
    • getJNIEnv

      public ImagePointer getJNIEnv() throws CorruptDataException
      Description copied from interface: JavaThread
      Get the address of the JNIEnv structure which represents this thread instance in JNI.
      Specified by:
      getJNIEnv in interface JavaThread
      Returns:
      the address of the JNIEnv structure which represents this thread instance in JNI
      Throws:
      CorruptDataException
    • getName

      public String getName() throws CorruptDataException
      Description copied from interface: JavaThread
      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.
      Specified by:
      getName in interface JavaThread
      Returns:
      the name of the thread
      Throws:
      CorruptDataException
    • getObject

      public JavaObject getObject() throws CorruptDataException
      Description copied from interface: JavaThread
      Fetch the java.lang.Thread associated with this thread. If the thread is in the process of being attached, this may return null.
      Specified by:
      getObject in interface JavaThread
      Returns:
      the a JavaObject representing the java.lang.Thread associated with this thread
      Throws:
      CorruptDataException
      See Also:
    • getPriority

      public int getPriority() throws CorruptDataException
      Description copied from interface: JavaThread
      Get the Java priority of the thread.
      Specified by:
      getPriority in interface JavaThread
      Returns:
      the Java priority of the thread (a number between 1 and 10 inclusive)
      Throws:
      CorruptDataException
      See Also:
    • getStackFrames

      public Iterator getStackFrames()
      Description copied from interface: JavaThread
      Get the set of stack frames.
      Specified by:
      getStackFrames in interface JavaThread
      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:
    • addStackFrame

      public void addStackFrame(JavaStackFrame javaStackFrame)
    • getStackSections

      public Iterator getStackSections()
      Description copied from interface: JavaThread
      Get the set of ImageSections which make up the managed stack.
      Specified by:
      getStackSections in interface JavaThread
      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:
    • getState

      public int getState() throws CorruptDataException
      Description copied from interface: JavaThread
      Get the state of the thread when the image was created.
      Specified by:
      getState in interface JavaThread
      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
    • setImageThread

      public void setImageThread(JCImageThread imageThread)
      NON-DTFJ
      Parameters:
      imageThread -
    • internalGetImageThread

      public JCImageThread internalGetImageThread()
      NON-DTFJ. For internal building purposes. Do not call as part of DTFJ.
      Returns:
      image thread or null if non found.
    • setName

      public void setName(String name)
      NON-DTFJ
      Parameters:
      name -
    • setPriority

      public void setPriority(int priority)
      NON-DTFJ
      Parameters:
      priority -
    • setState

      public void setState(String state)
      NON-DTFJ
      Parameters:
      state -
    • getThreadID

      public ImagePointer getThreadID()
      Not in DTFJ. Used only for building purposes.
    • setJNIEnv

      public ImagePointer setJNIEnv(ImagePointer env)
      Not in DTFJ. Used only for building purposes.
    • setObject

      public void setObject(JavaObject threadObject)
      NOT in DTFJ
      Parameters:
      threadObject -
    • setBlockingObject

      public void setBlockingObject(JavaObject blockingObject)
      NOT in DTFJ
      Parameters:
      blockingObject -
    • getBlockingObject

      public JavaObject getBlockingObject() throws CorruptDataException, DataUnavailable
      Description copied from interface: JavaThread
      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()
      Specified by:
      getBlockingObject in interface JavaThread
      Returns:
      the object this thread is waiting on or null.
      Throws:
      CorruptDataException
      DataUnavailable