Eclipse JDT
2.0

org.eclipse.jdt.debug.core
Interface IJavaThread

All Superinterfaces:
IAdaptable, IDebugElement, IStep, ISuspendResume, ITerminate, IThread

public interface IJavaThread
extends IThread

A thread in a Java virtual machine.

Clients are not intended to implement this interface.

See Also:
IThread

Field Summary
static int ERR_INCOMPATIBLE_THREAD_STATE
          Status code indicating a request to perform a message send failed because a thread was not suspended by a step or breakpoint event.
static int ERR_NESTED_METHOD_INVOCATION
          Status code indicating a request to perform a message send failed because a thread was already performing a message send.
static int ERR_THREAD_NOT_SUSPENDED
          Status code indicating a request failed because a thread was not suspended.
 
Method Summary
 IJavaVariable findVariable(String variableName)
          Returns a variable with the given name, or null if unable to resolve a variable with the name, or if this thread is not currently suspended.
 String getThreadGroupName()
          Returns the name of the thread group this thread belongs to, or null if none.
 boolean isOutOfSynch()
          Returns whether any of the stack frames associated with this thread are running code in the VM that is out of synch with the code in the workspace.
 boolean isPerformingEvaluation()
          Returns whether this thread is currently performing an evaluation.
 boolean isSystemThread()
          Returns whether this thread is a system thread.
 boolean mayBeOutOfSynch()
          Returns whether this thread may be running code in the VM that is out of synch with the code in the workspace.
 void runEvaluation(IEvaluationRunnable evaluation, IProgressMonitor monitor, int evaluationDetail, boolean hitBreakpoints)
          Invokes the given evaluation with the specfied progress monitor.
 
Methods inherited from interface org.eclipse.debug.core.model.IThread
getBreakpoints, getName, getPriority, getStackFrames, getTopStackFrame, hasStackFrames
 
Methods inherited from interface org.eclipse.debug.core.model.IDebugElement
getDebugTarget, getLaunch, getModelIdentifier
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.debug.core.model.ISuspendResume
canResume, canSuspend, isSuspended, resume, suspend
 
Methods inherited from interface org.eclipse.debug.core.model.IStep
canStepInto, canStepOver, canStepReturn, isStepping, stepInto, stepOver, stepReturn
 
Methods inherited from interface org.eclipse.debug.core.model.ITerminate
canTerminate, isTerminated, terminate
 

Field Detail

ERR_THREAD_NOT_SUSPENDED

public static final int ERR_THREAD_NOT_SUSPENDED
Status code indicating a request failed because a thread was not suspended.

See Also:
Constant Field Values

ERR_NESTED_METHOD_INVOCATION

public static final int ERR_NESTED_METHOD_INVOCATION
Status code indicating a request to perform a message send failed because a thread was already performing a message send.

See Also:
IJavaObject.sendMessage(String, String, IJavaValue[], IJavaThread, boolean), IJavaClassType.sendMessage(String, String, IJavaValue[], IJavaThread), IJavaClassType.newInstance(String, IJavaValue[], IJavaThread), Constant Field Values

ERR_INCOMPATIBLE_THREAD_STATE

public static final int ERR_INCOMPATIBLE_THREAD_STATE
Status code indicating a request to perform a message send failed because a thread was not suspended by a step or breakpoint event. When a thread is suspended explicitly via the suspend() method, it is not able to perform method invocations (this is a JDI limitation).

See Also:
IJavaObject.sendMessage(String, String, IJavaValue[], IJavaThread, boolean), IJavaClassType.sendMessage(String, String, IJavaValue[], IJavaThread), IJavaClassType.newInstance(String, IJavaValue[], IJavaThread), Constant Field Values
Method Detail

isSystemThread

public boolean isSystemThread()
                       throws DebugException
Returns whether this thread is a system thread.

Returns:
whether this thread is a system thread
Throws:
DebugException - if this method fails. Reasons include:
  • Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.

isOutOfSynch

public boolean isOutOfSynch()
                     throws DebugException
Returns whether any of the stack frames associated with this thread are running code in the VM that is out of synch with the code in the workspace.

Returns:
whether this thread is out of synch with the workspace.
Throws:
DebugException - if this method fails. Reasons include:
  • Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
  • Since:
    2.0

mayBeOutOfSynch

public boolean mayBeOutOfSynch()
                        throws DebugException
Returns whether this thread may be running code in the VM that is out of synch with the code in the workspace.

Returns:
whether this thread may be out of synch with the workspace.
Throws:
DebugException - if this method fails. Reasons include:
  • Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
  • Since:
    2.0

isPerformingEvaluation

public boolean isPerformingEvaluation()
Returns whether this thread is currently performing an evaluation.

Returns:
whether this thread is currently performing an evaluation
Since:
2.0

getThreadGroupName

public String getThreadGroupName()
                          throws DebugException
Returns the name of the thread group this thread belongs to, or null if none.

Returns:
thread group name, or null if none
Throws:
DebugException - if this method fails. Reasons include:
  • Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.

findVariable

public IJavaVariable findVariable(String variableName)
                           throws DebugException
Returns a variable with the given name, or null if unable to resolve a variable with the name, or if this thread is not currently suspended.

Variable lookup works only when a thread is suspended. Lookup is performed in all stack frames, in a top-down order, returning the first successful match, or null if no match is found.

Parameters:
variableName - the name of the variable to search for
Returns:
a variable, or null if none
Throws:
DebugException - if this method fails. Reasons include:
  • Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.

runEvaluation

public void runEvaluation(IEvaluationRunnable evaluation,
                          IProgressMonitor monitor,
                          int evaluationDetail,
                          boolean hitBreakpoints)
                   throws DebugException
Invokes the given evaluation with the specfied progress monitor. This thread fires a resume event when the evaluation begins, and a suspend event when the evaluation completes or throws an exception. The events are given a detail as specified by evaluationDetail (one of DebugEvent.EVALUATION or DebugEvent.EVALUATION_IMPLICIT).

Parameters:
evaluation - the evalation to perform
monitor - progress monitor (may be null
evaluationDetail - one of DebugEvent.EVALUATION or DebugEvent.EVALUATION_IMPLICIT
hitBreakpoints - whether or not breakpoints should be honored in this thread during the evaluation. If false, breakpoints hit in this thread during the evaluation will be ignored.
Throws:
DebugException - if an exception occurs performing the evaluation
Since:
2.0

Eclipse JDT
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.