org.eclipse.datatools.sqltools.routineeditor.launching
Class SPDebugTarget_Run

java.lang.Object
  extended by org.eclipse.datatools.sqltools.routineeditor.launching.SPDebugTarget_Run
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, IConnectionTracker, org.eclipse.debug.core.IBreakpointListener, org.eclipse.debug.core.model.IDebugElement, org.eclipse.debug.core.model.IDebugTarget, org.eclipse.debug.core.model.IDisconnect, org.eclipse.debug.core.model.IMemoryBlockRetrieval, org.eclipse.debug.core.model.ISuspendResume, org.eclipse.debug.core.model.ITerminate

public class SPDebugTarget_Run
extends java.lang.Object
implements org.eclipse.debug.core.model.IDebugTarget, IConnectionTracker

This a very simple implementation of "run" mode. The debug target don't have child thread, and simply trace the connection's connected status. Currently treat "terminate" and "disconnect" status as almost same. In the future may change. XXX: today this class is not extending SPDebugElement, because SPDebugElement depends too much on SPDebugTarget. In the future we may want to make SPDebugTarget and SPDebugTarget_Run to extending from some common class. But for now, as SPDebugTarget_Run is so simple, no need for that.

Author:
Yang Liu

Constructor Summary
SPDebugTarget_Run(org.eclipse.debug.core.ILaunch launch, org.eclipse.debug.core.model.IProcess process, java.lang.String name, java.sql.Connection conn)
           
 
Method Summary
 void breakpointAdded(org.eclipse.debug.core.model.IBreakpoint breakpoint)
           
 void breakpointChanged(org.eclipse.debug.core.model.IBreakpoint breakpoint, org.eclipse.core.resources.IMarkerDelta delta)
           
 void breakpointRemoved(org.eclipse.debug.core.model.IBreakpoint breakpoint, org.eclipse.core.resources.IMarkerDelta delta)
           
 boolean canDisconnect()
           
 boolean canResume()
           
 boolean canSuspend()
           
 boolean canTerminate()
           
 void connectionAboutToBeClosed()
          Default implementation does nothing
 void connectionClosed()
          Notifies the listener that the connection being tracked is closed.
 void disconnect()
           
 java.lang.Object getAdapter(java.lang.Class adapter)
           
 org.eclipse.debug.core.model.IDebugTarget getDebugTarget()
           
 org.eclipse.debug.core.ILaunch getLaunch()
           
 org.eclipse.debug.core.model.IMemoryBlock getMemoryBlock(long startAddress, long length)
           
 java.lang.String getModelIdentifier()
           
 java.lang.String getName()
           
 org.eclipse.debug.core.model.IProcess getProcess()
           
 org.eclipse.debug.core.model.IThread[] getThreads()
           
 boolean hasThreads()
           
 boolean isDisconnected()
           
 boolean isSuspended()
           
 boolean isTerminated()
           
 void notSupported(java.lang.String message)
          Throws a new debug exception with a status code of NOT_SUPPORTED.
 void resume()
           
 boolean supportsBreakpoint(org.eclipse.debug.core.model.IBreakpoint breakpoint)
           
 boolean supportsStorageRetrieval()
           
 void suspend()
           
 void terminate()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SPDebugTarget_Run

public SPDebugTarget_Run(org.eclipse.debug.core.ILaunch launch,
                         org.eclipse.debug.core.model.IProcess process,
                         java.lang.String name,
                         java.sql.Connection conn)
Method Detail

canTerminate

public boolean canTerminate()
Specified by:
canTerminate in interface org.eclipse.debug.core.model.ITerminate

isTerminated

public boolean isTerminated()
Specified by:
isTerminated in interface org.eclipse.debug.core.model.ITerminate

terminate

public void terminate()
               throws org.eclipse.debug.core.DebugException
Specified by:
terminate in interface org.eclipse.debug.core.model.ITerminate
Throws:
org.eclipse.debug.core.DebugException

canDisconnect

public boolean canDisconnect()
Specified by:
canDisconnect in interface org.eclipse.debug.core.model.IDisconnect

disconnect

public void disconnect()
                throws org.eclipse.debug.core.DebugException
Specified by:
disconnect in interface org.eclipse.debug.core.model.IDisconnect
Throws:
org.eclipse.debug.core.DebugException

isDisconnected

public boolean isDisconnected()
Specified by:
isDisconnected in interface org.eclipse.debug.core.model.IDisconnect

connectionClosed

public void connectionClosed()
Description copied from interface: IConnectionTracker
Notifies the listener that the connection being tracked is closed.

Specified by:
connectionClosed in interface IConnectionTracker

notSupported

public void notSupported(java.lang.String message)
                  throws org.eclipse.debug.core.DebugException
Throws a new debug exception with a status code of NOT_SUPPORTED.

Parameters:
message - Failure message
Throws:
org.eclipse.debug.core.DebugException - The exception with a status code of NOT_SUPPORTED.

getProcess

public org.eclipse.debug.core.model.IProcess getProcess()
Specified by:
getProcess in interface org.eclipse.debug.core.model.IDebugTarget

getName

public java.lang.String getName()
                         throws org.eclipse.debug.core.DebugException
Specified by:
getName in interface org.eclipse.debug.core.model.IDebugTarget
Throws:
org.eclipse.debug.core.DebugException

getModelIdentifier

public java.lang.String getModelIdentifier()
Specified by:
getModelIdentifier in interface org.eclipse.debug.core.model.IDebugElement

getDebugTarget

public org.eclipse.debug.core.model.IDebugTarget getDebugTarget()
Specified by:
getDebugTarget in interface org.eclipse.debug.core.model.IDebugElement

getLaunch

public org.eclipse.debug.core.ILaunch getLaunch()
Specified by:
getLaunch in interface org.eclipse.debug.core.model.IDebugElement

getThreads

public org.eclipse.debug.core.model.IThread[] getThreads()
                                                  throws org.eclipse.debug.core.DebugException
Specified by:
getThreads in interface org.eclipse.debug.core.model.IDebugTarget
Throws:
org.eclipse.debug.core.DebugException

hasThreads

public boolean hasThreads()
                   throws org.eclipse.debug.core.DebugException
Specified by:
hasThreads in interface org.eclipse.debug.core.model.IDebugTarget
Throws:
org.eclipse.debug.core.DebugException

supportsBreakpoint

public boolean supportsBreakpoint(org.eclipse.debug.core.model.IBreakpoint breakpoint)
Specified by:
supportsBreakpoint in interface org.eclipse.debug.core.model.IDebugTarget

canResume

public boolean canResume()
Specified by:
canResume in interface org.eclipse.debug.core.model.ISuspendResume

canSuspend

public boolean canSuspend()
Specified by:
canSuspend in interface org.eclipse.debug.core.model.ISuspendResume

isSuspended

public boolean isSuspended()
Specified by:
isSuspended in interface org.eclipse.debug.core.model.ISuspendResume

resume

public void resume()
            throws org.eclipse.debug.core.DebugException
Specified by:
resume in interface org.eclipse.debug.core.model.ISuspendResume
Throws:
org.eclipse.debug.core.DebugException

suspend

public void suspend()
             throws org.eclipse.debug.core.DebugException
Specified by:
suspend in interface org.eclipse.debug.core.model.ISuspendResume
Throws:
org.eclipse.debug.core.DebugException

breakpointAdded

public void breakpointAdded(org.eclipse.debug.core.model.IBreakpoint breakpoint)
Specified by:
breakpointAdded in interface org.eclipse.debug.core.IBreakpointListener

breakpointRemoved

public void breakpointRemoved(org.eclipse.debug.core.model.IBreakpoint breakpoint,
                              org.eclipse.core.resources.IMarkerDelta delta)
Specified by:
breakpointRemoved in interface org.eclipse.debug.core.IBreakpointListener

breakpointChanged

public void breakpointChanged(org.eclipse.debug.core.model.IBreakpoint breakpoint,
                              org.eclipse.core.resources.IMarkerDelta delta)
Specified by:
breakpointChanged in interface org.eclipse.debug.core.IBreakpointListener

supportsStorageRetrieval

public boolean supportsStorageRetrieval()
Specified by:
supportsStorageRetrieval in interface org.eclipse.debug.core.model.IMemoryBlockRetrieval

getMemoryBlock

public org.eclipse.debug.core.model.IMemoryBlock getMemoryBlock(long startAddress,
                                                                long length)
                                                         throws org.eclipse.debug.core.DebugException
Specified by:
getMemoryBlock in interface org.eclipse.debug.core.model.IMemoryBlockRetrieval
Throws:
org.eclipse.debug.core.DebugException

getAdapter

public java.lang.Object getAdapter(java.lang.Class adapter)
Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable

connectionAboutToBeClosed

public void connectionAboutToBeClosed()
Default implementation does nothing

Specified by:
connectionAboutToBeClosed in interface IConnectionTracker