org.eclipse.emf.mwe.internal.core.debug.processing.handlers
Class BreakpointRuntimeHandler

java.lang.Object
  extended by org.eclipse.emf.mwe.internal.core.debug.processing.handlers.BreakpointRuntimeHandler
All Implemented Interfaces:
java.lang.Runnable, ProcessHandler, RuntimeHandler

public class BreakpointRuntimeHandler
extends java.lang.Object
implements RuntimeHandler, ProcessHandler, java.lang.Runnable

This class handles the communication of Breakpoints on the runtime side. It listens in an extra thread for set and removal of breakpoints. The DebugMonitor uses this class to suspend the runtime process at breakpoints.


Field Summary
protected  Connection connection
           
protected  DebugMonitor monitor
           
static int REMOVE
           
static int SET
           
 
Fields inherited from interface org.eclipse.emf.mwe.internal.core.debug.processing.ProcessHandler
INTERRUPT, POP, PUSH, SHALL_HANDLE, SUSPEND
 
Constructor Summary
BreakpointRuntimeHandler()
           
 
Method Summary
 void init(DebugMonitor monitor, Connection connection)
          initiate the instantiated handler.
 boolean isLastCall()
          if true, the handler has the last call and will be processed at the last handler
 void run()
           
 boolean shallHandle(boolean lastState, java.lang.Object element, int flag)
          no contribution here
 boolean shallInterrupt(boolean lastState)
          no contribution here
 boolean shallSuspend(boolean lastState, java.lang.Object element, int flag)
          returns true if a breakpoint is rgeistered for that element
 void startListener()
          start the listening process in an extra thread, if required
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SET

public static final int SET
See Also:
Constant Field Values

REMOVE

public static final int REMOVE
See Also:
Constant Field Values

connection

protected Connection connection

monitor

protected DebugMonitor monitor
Constructor Detail

BreakpointRuntimeHandler

public BreakpointRuntimeHandler()
Method Detail

init

public void init(DebugMonitor monitor,
                 Connection connection)
Description copied from interface: RuntimeHandler
initiate the instantiated handler. It gets the DebugMonitor and Connection instances that may be needed for the handler to do it's work
the handler may be registered at the DebugMonitor dependent on the type of handler.

Specified by:
init in interface RuntimeHandler
Parameters:
monitor - the DebugMonitor
connection - the connection to the debugger framework
See Also:
RuntimeHandler.init(org.eclipse.emf.mwe.internal.core.debug.processing.DebugMonitor, org.eclipse.emf.mwe.internal.core.debug.communication.Connection)

startListener

public void startListener()
Description copied from interface: RuntimeHandler
start the listening process in an extra thread, if required

Specified by:
startListener in interface RuntimeHandler
See Also:
RuntimeHandler.startListener()

run

public void run()
Specified by:
run in interface java.lang.Runnable
See Also:
Runnable.run()

isLastCall

public boolean isLastCall()
Description copied from interface: ProcessHandler
if true, the handler has the last call and will be processed at the last handler

Specified by:
isLastCall in interface ProcessHandler
Returns:
whether or not

shallSuspend

public boolean shallSuspend(boolean lastState,
                            java.lang.Object element,
                            int flag)
returns true if a breakpoint is rgeistered for that element

Specified by:
shallSuspend in interface ProcessHandler
Parameters:
lastState - the consolidated decisions of previously asked listeners
element - the element that is questioned
flag - one of the values IEventHandler.NORMAL_FRAME or IEventHandler.END_FRAME
Returns:
if the process shall suspend based on the last state and the evaluation of the current element
See Also:
ProcessHandler.shallSuspend(boolean, java.lang.Object, int)

shallHandle

public boolean shallHandle(boolean lastState,
                           java.lang.Object element,
                           int flag)
no contribution here

Specified by:
shallHandle in interface ProcessHandler
Parameters:
lastState - the consolidated decisions of previously asked listeners
element - the element that is questioned
flag - one of the values IProcessHandler.PUSH or IProcessHandler.POP
Returns:
See Also:
ProcessHandler.shallHandle(boolean, java.lang.Object, int)

shallInterrupt

public boolean shallInterrupt(boolean lastState)
no contribution here

Specified by:
shallInterrupt in interface ProcessHandler
Parameters:
lastState - the consolidated decisions of previously asked listeners
Returns:
if the process shall be interrupted based on the last state and the evaluation of the current element
See Also:
ProcessHandler.shallInterrupt(boolean)