org.eclipse.datatools.sqltools.debugger.model
Class SPThread

java.lang.Object
  extended byPlatformObject
      extended byorg.eclipse.datatools.sqltools.debugger.model.SPDebugElement
          extended byorg.eclipse.datatools.sqltools.debugger.model.SPThread
All Implemented Interfaces:
IConnectionTracker

public abstract class SPThread
extends SPDebugElement
implements IConnectionTracker

This is the super class for stored procedure thread. Different SQL server type may implement different SPThread.

Author:
Yang Liu
See Also:
Serialized Form

Field Summary
static IBreakpoint[] EMPTY_BREAKPOINTS
          A convenience field for methods to return empty breakpoints
 
Constructor Summary
SPThread(SPDebugTarget target, DatabaseIdentifier databaseIdentifier)
           
 
Method Summary
 void breakpointHit()
          Called when an breakpoint is hit.
 boolean canDisconnect()
           
 boolean canResume()
           
 boolean canStepInto()
           
 boolean canStepOver()
           
 boolean canStepReturn()
           
 boolean canSuspend()
           
 void connectionClosed()
          Called by event handler when connection is closed.
abstract  void disconnect()
           
 SPValue evaluateExpression(java.lang.String expression)
          Evaluates the given expression.
 IStackFrame getBottomStackFrame()
           
 DatabaseIdentifier getDatabaseIdentifier()
           
abstract  java.sql.Connection getDebuggerConnection()
           
 IVariable[] getGlobalVariables()
          Gets global variables.
 int getPriority()
           
 IStackFrame[] getStackFrames()
           
 java.util.List getStackFramesAsList()
          Returns the stack frame list.
 IStackFrame getTopStackFrame()
           
 boolean hasStackFrames()
           
 void interrupted()
          Called when the connection is interrupted.
 boolean isStepping()
           
 boolean isSuspended()
           
 boolean isTerminated()
           
 void singleStepped()
          Called when the connection suspended because a step end.
 boolean supportEvaluateExpression()
          Returns whether supports evaluate expresion.
 boolean supportsBreakpoint(IBreakpoint breakpoint)
           
 
Methods inherited from class org.eclipse.datatools.sqltools.debugger.model.SPDebugElement
fireChangeEvent, fireResumeEvent, fireSuspendEvent, getAdapter, getDebugTarget, getLaunch, getModelIdentifier, getSPDebugTarget, notSupported
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_BREAKPOINTS

public static final IBreakpoint[] EMPTY_BREAKPOINTS
A convenience field for methods to return empty breakpoints

Constructor Detail

SPThread

public SPThread(SPDebugTarget target,
                DatabaseIdentifier databaseIdentifier)
Parameters:
target -
Method Detail

getDatabaseIdentifier

public DatabaseIdentifier getDatabaseIdentifier()

getStackFramesAsList

public java.util.List getStackFramesAsList()
                                    throws DebugException
Returns the stack frame list. The caller should not change the returned list, it should be considered readonly. It is almost same as getStackFrames, just don't convert into array, so more efficient.

Returns:
Throws:
DebugException

getStackFrames

public IStackFrame[] getStackFrames()
                             throws DebugException
Throws:
DebugException

hasStackFrames

public boolean hasStackFrames()
                       throws DebugException
Throws:
DebugException

getPriority

public int getPriority()
                throws DebugException
Throws:
DebugException

getTopStackFrame

public IStackFrame getTopStackFrame()
                             throws DebugException
Throws:
DebugException

getBottomStackFrame

public IStackFrame getBottomStackFrame()
                                throws DebugException
Throws:
DebugException

getGlobalVariables

public IVariable[] getGlobalVariables()
                               throws DebugException
Gets global variables. If is suspended, will return empty array.

Returns:
will never be null
Throws:
DebugException

supportsBreakpoint

public boolean supportsBreakpoint(IBreakpoint breakpoint)

canResume

public boolean canResume()

canSuspend

public boolean canSuspend()

isSuspended

public boolean isSuspended()

canStepInto

public boolean canStepInto()

canStepOver

public boolean canStepOver()

canStepReturn

public boolean canStepReturn()

isStepping

public boolean isStepping()

isTerminated

public boolean isTerminated()

canDisconnect

public boolean canDisconnect()

breakpointHit

public final void breakpointHit()
Called when an breakpoint is hit.


interrupted

public final void interrupted()
Called when the connection is interrupted.


singleStepped

public final void singleStepped()
Called when the connection suspended because a step end.


connectionClosed

public void connectionClosed()
Called by event handler when connection is closed. Or when the client thread noticed that the client connection is closed.

Specified by:
connectionClosed in interface IConnectionTracker

disconnect

public abstract void disconnect()
                         throws DebugException
Throws:
DebugException

supportEvaluateExpression

public boolean supportEvaluateExpression()
Returns whether supports evaluate expresion. Child classes can override this and implement evaluateExpression if expression evaluation is required.

Returns:
false by default

evaluateExpression

public SPValue evaluateExpression(java.lang.String expression)
                           throws DebugException
Evaluates the given expression. The default implementation throws DebugException

Parameters:
expression -
Returns:
Throws:
DebugException

getDebuggerConnection

public abstract java.sql.Connection getDebuggerConnection()


Copyright © 2006 Actuate, IBM Corporation, Sybase, Inc. and others. All rights reserved.