org.apache.bsf.engines.javascript

Class RhinoEngineDebugger

Implemented Interfaces:
Debugger

public class RhinoEngineDebugger
extends java.lang.Object
implements Debugger

Constructor Summary

RhinoEngineDebugger(JavaScriptEngine eng)

Method Summary

void
_handleBreakpointHit(DocumentCell cell, int lineno)
void
disconnectedDebuggerNotify()
Called when our debugger has been disconnected.
Object
eval(String docname, String fnOrScript, int lineno)
JsContext
getContext(int depth)
int
getContextCount()
Object
getDebugInterface()
JsCallbacks
getDebugger()
Return the current debugger.
DocumentCell
getDocumentCell(String name)
JsObject
getGlobalObject()
RhinoContextProxy
getRhinoContextProxy()
String
getThread()
String
getThreadGroup()
JsObject
getUndefinedValue()
void
handleBreakpointHit(Context cx)
void
handleCompilationDone(Context cx, DebuggableScript fnOrScript, StringBuffer source)
void
handleExceptionThrown(Context cx, Object exceptionThrown)
DocumentCell
loadDocumentNotify(String name)
void
placeBreakpointAtLine(int brkptid, String docname, int lineno)
void
placeBreakpointAtOffset(int brkptid, String docname, int offset)
void
removeBreakpoint(String docname, int brkptid)
void
run(JsEngineStub eng)
void
setBreakNextLine(JsContext context, boolean isLineStep)
Set whether the engine should break when it encounters the next line.
void
setDebugger(JsCallbacks debugger)
Set the associated debugger.
void
setEntryExit(String docname, boolean on)
void
stepIn(JsEngineStub eng)
void
stepOut(JsEngineStub eng)
void
stepOver(JsEngineStub eng)

Constructor Details

RhinoEngineDebugger

public RhinoEngineDebugger(JavaScriptEngine eng)
            throws RemoteException

Method Details

_handleBreakpointHit

public void _handleBreakpointHit(DocumentCell cell,
                                 int lineno)

disconnectedDebuggerNotify

public void disconnectedDebuggerNotify()
Called when our debugger has been disconnected.

eval

public Object eval(String docname,
                   String fnOrScript,
                   int lineno)
            throws RemoteException

getContext

public JsContext getContext(int depth)

getContextCount

public int getContextCount()

getDebugInterface

public Object getDebugInterface()

getDebugger

public JsCallbacks getDebugger()
Return the current debugger.
Returns:
the debugger, or null if none is attached.

getDocumentCell

public DocumentCell getDocumentCell(String name)

getGlobalObject

public JsObject getGlobalObject()

getRhinoContextProxy

public RhinoContextProxy getRhinoContextProxy()

getThread

public String getThread()

getThreadGroup

public String getThreadGroup()

getUndefinedValue

public JsObject getUndefinedValue()

handleBreakpointHit

public void handleBreakpointHit(Context cx)

handleCompilationDone

public void handleCompilationDone(Context cx,
                                  DebuggableScript fnOrScript,
                                  StringBuffer source)

handleExceptionThrown

public void handleExceptionThrown(Context cx,
                                  Object exceptionThrown)

loadDocumentNotify

public DocumentCell loadDocumentNotify(String name)

placeBreakpointAtLine

public void placeBreakpointAtLine(int brkptid,
                                  String docname,
                                  int lineno)

placeBreakpointAtOffset

public void placeBreakpointAtOffset(int brkptid,
                                    String docname,
                                    int offset)

removeBreakpoint

public void removeBreakpoint(String docname,
                             int brkptid)
            throws BSFException

run

public void run(JsEngineStub eng)
            throws Exception

setBreakNextLine

public void setBreakNextLine(JsContext context,
                             boolean isLineStep)
Set whether the engine should break when it encounters the next line.

The engine will call the attached debugger's handleBreakpointHit method on the next line it executes if isLineStep is true. May be used from another thread to interrupt execution.

Parameters:
isLineStep - if true, break next line

setDebugger

public void setDebugger(JsCallbacks debugger)
Set the associated debugger.
Parameters:
debugger - the debugger to be used on callbacks from the engine.

setEntryExit

public void setEntryExit(String docname,
                         boolean on)
            throws BSFException

stepIn

public void stepIn(JsEngineStub eng)
            throws Exception

stepOut

public void stepOut(JsEngineStub eng)
            throws Exception

stepOver

public void stepOver(JsEngineStub eng)
            throws Exception