org.netbeans.api.debugger.jpda
Interface JPDAThread

All Superinterfaces:
org.netbeans.api.debugger.jpda.DummyPrivate

public interface JPDAThread
extends org.netbeans.api.debugger.jpda.DummyPrivate

Represents one Java thread in debugged process.


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.
 org.netbeans.api.debugger.jpda.DummyPrivate getDummy()
           
 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

public static final int STATE_UNKNOWN
Thread state constant.

See Also:
Constant Field Values

STATE_MONITOR

public static final int STATE_MONITOR
Thread state constant.

See Also:
Constant Field Values

STATE_NOT_STARTED

public static final int STATE_NOT_STARTED
Thread state constant.

See Also:
Constant Field Values

STATE_RUNNING

public static final int STATE_RUNNING
Thread state constant.

See Also:
Constant Field Values

STATE_SLEEPING

public static final int STATE_SLEEPING
Thread state constant.

See Also:
Constant Field Values

STATE_WAIT

public static final int STATE_WAIT
Thread state constant.

See Also:
Constant Field Values

STATE_ZOMBIE

public static final int STATE_ZOMBIE
Thread state constant.

See Also:
Constant Field Values

PROP_CALLSTACK

public static final String PROP_CALLSTACK
Property name constant.

See Also:
Constant Field Values

PROP_VARIABLES

public static final String PROP_VARIABLES
Property name constant.

See Also:
Constant Field Values
Method Detail

getName

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

Returns:
name of thread

getParentThreadGroup

public JPDAThreadGroup getParentThreadGroup()
Returns parent thread group.

Returns:
parent thread group

getLineNumber

public 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

public int getState()
Returns current state of this thread.

Returns:
current state of this thread

isSuspended

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

Returns:
true if this thread is suspended by debugger

getClassName

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

Returns:
class name this thread is stopped in

getMethodName

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

Returns:
method name this thread is stopped in

suspend

public void suspend()
Suspends thread.


resume

public void resume()
Unsuspends thread.


interrupt

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


getSourceName

public 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

public 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

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

Returns:
call stack
Throws:
NoInformationException - if the thread is running or not able to return callstack
com.sun.jdi.AbsentInformationException

getCallStack

public 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:
NoInformationException - if the thread is running or not able to return callstack
com.sun.jdi.AbsentInformationException

getStackDepth

public int getStackDepth()
Returns length of current call stack.

Returns:
length of current call stack

makeCurrent

public void makeCurrent()
Sets this thread current.

See Also:
JPDADebugger.getCurrentThread()

getContendedMonitor

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

Returns:
monitor this thread is waiting on

getOwnedMonitors

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

Returns:
monitors owned by this thread

getDummy

public org.netbeans.api.debugger.jpda.DummyPrivate getDummy()

 

Built on May 20 2005.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.