org.netbeans.api.debugger.jpda/2 2.4.22

org.netbeans.api.debugger.jpda
Interface JPDAThread


public interface JPDAThread

Represents one Java thread in debugged process.

 Since JDI interfaces evolve from one version to another, it's strongly recommended
 not to implement this interface in client code. New methods can be added to
 this interface at any time to keep up with the JDI functionality.


Field Summary
static String PROP_CALLSTACK
          Property name constant.
static String PROP_VARIABLES
          Property name constant.
static int STATE_MONITOR
          Thread state constant.
static int STATE_NOT_STARTED
          Thread state constant.
static int STATE_RUNNING
          Thread state constant.
static int STATE_SLEEPING
          Thread state constant.
static int STATE_UNKNOWN
          Thread state constant.
static int STATE_WAIT
          Thread state constant.
static int STATE_ZOMBIE
          Thread state constant.
 
Method Summary
 CallStackFrame[] getCallStack()
          Returns call stack for this thread.
 CallStackFrame[] getCallStack(int from, int to)
          Returns call stack for this thread on the given indexes.
 String getClassName()
          If this thread is suspended returns class name this thread is stopped in.
 ObjectVariable getContendedMonitor()
          Returns monitor this thread is waiting on.
 int getLineNumber(String stratum)
          Returns line number of the location this thread stopped at.
 String getMethodName()
          If this thread is suspended returns method name this thread is stopped in.
 String getName()
          Getter for the name of thread property.
 ObjectVariable[] getOwnedMonitors()
          Returns monitors owned by this thread.
 JPDAThreadGroup getParentThreadGroup()
          Returns parent thread group.
 String getSourceName(String stratum)
          Returns file name this frame is stopped in or null.
 String getSourcePath(String stratum)
          Returns source path of file this frame is stopped in or null.
 int getStackDepth()
          Returns length of current call stack.
 int getState()
          Returns current state of this thread.
 void interrupt()
          Interrupts this thread unless the thread has been suspended.
 boolean isSuspended()
          Returns true if this thread is suspended by debugger.
 void makeCurrent()
          Sets this thread current.
 void resume()
          Unsuspends thread.
 void suspend()
          Suspends thread.
 

Field Detail

STATE_UNKNOWN

static final int STATE_UNKNOWN
Thread state constant.

See Also:
Constant Field Values

STATE_MONITOR

static final int STATE_MONITOR
Thread state constant.

See Also:
Constant Field Values

STATE_NOT_STARTED

static final int STATE_NOT_STARTED
Thread state constant.

See Also:
Constant Field Values

STATE_RUNNING

static final int STATE_RUNNING
Thread state constant.

See Also:
Constant Field Values

STATE_SLEEPING

static final int STATE_SLEEPING
Thread state constant.

See Also:
Constant Field Values

STATE_WAIT

static final int STATE_WAIT
Thread state constant.

See Also:
Constant Field Values

STATE_ZOMBIE

static final int STATE_ZOMBIE
Thread state constant.

See Also:
Constant Field Values

PROP_CALLSTACK

static final String PROP_CALLSTACK
Property name constant.

See Also:
Constant Field Values

PROP_VARIABLES

static final String PROP_VARIABLES
Property name constant.

See Also:
Constant Field Values
Method Detail

getName

String getName()
Getter for the name of thread property.

Returns:
name of thread

getParentThreadGroup

JPDAThreadGroup getParentThreadGroup()
Returns parent thread group.

Returns:
parent thread group

getLineNumber

int getLineNumber(String stratum)
Returns line number of the location this thread stopped at. The thread should be suspended at the moment this method is called.

Returns:
line number of the current location if the thread is suspended, contains at least one frame and the topmost frame does not represent a native method invocation; -1 otherwise
See Also:
CallStackFrame

getState

int getState()
Returns current state of this thread.

Returns:
current state of this thread

isSuspended

boolean isSuspended()
Returns true if this thread is suspended by debugger.

Returns:
true if this thread is suspended by debugger

getClassName

String getClassName()
If this thread is suspended returns class name this thread is stopped in.

Returns:
class name this thread is stopped in

getMethodName

String getMethodName()
If this thread is suspended returns method name this thread is stopped in.

Returns:
method name this thread is stopped in

suspend

void suspend()
Suspends thread.


resume

void resume()
Unsuspends thread.


interrupt

void interrupt()
Interrupts this thread unless the thread has been suspended.

Since:
2.1

getSourceName

String getSourceName(String stratum)
                     throws com.sun.jdi.AbsentInformationException
Returns file name this frame is stopped in or null.

Returns:
file name this frame is stopped in
Throws:
com.sun.jdi.AbsentInformationException

getSourcePath

String getSourcePath(String stratum)
                     throws com.sun.jdi.AbsentInformationException
Returns source path of file this frame is stopped in or null.

Returns:
source path of file this frame is stopped in or null
Throws:
com.sun.jdi.AbsentInformationException

getCallStack

CallStackFrame[] getCallStack()
                              throws com.sun.jdi.AbsentInformationException
Returns call stack for this thread.

Returns:
call stack
Throws:
com.sun.jdi.AbsentInformationException - if the thread is running or not able to return callstack. If the thread is in an incompatible state (e.g. running), the AbsentInformationException has IncompatibleThreadStateException as a cause.

getCallStack

CallStackFrame[] getCallStack(int from,
                              int to)
                              throws com.sun.jdi.AbsentInformationException
Returns call stack for this thread on the given indexes.

Parameters:
from - a from index
to - a to index
Returns:
call stack
Throws:
com.sun.jdi.AbsentInformationException - if the thread is running or not able to return callstack. If the thread is in an incompatible state (e.g. running), the AbsentInformationException has IncompatibleThreadStateException as a cause.

getStackDepth

int getStackDepth()
Returns length of current call stack.

Returns:
length of current call stack

makeCurrent

void makeCurrent()
Sets this thread current.

See Also:
JPDADebugger.getCurrentThread()

getContendedMonitor

ObjectVariable getContendedMonitor()
Returns monitor this thread is waiting on.

Returns:
monitor this thread is waiting on

getOwnedMonitors

ObjectVariable[] getOwnedMonitors()
Returns monitors owned by this thread.

Returns:
monitors owned by this thread

org.netbeans.api.debugger.jpda/2 2.4.22

Built on July 11 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.