org.apache.bsf.engines.javascript
Class RhinoEngineDebugger

java.lang.Object
  extended by org.apache.bsf.engines.javascript.RhinoEngineDebugger
All Implemented Interfaces:
org.mozilla.javascript.debug.Debugger

public class RhinoEngineDebugger
extends java.lang.Object
implements org.mozilla.javascript.debug.Debugger


Constructor Summary
RhinoEngineDebugger(JavaScriptEngine eng)
           
 
Method Summary
 void _handleBreakpointHit(DocumentCell cell, int lineno)
           
 void disconnectedDebuggerNotify()
          Called when our debugger has been disconnected.
 java.lang.Object eval(java.lang.String docname, java.lang.String fnOrScript, int lineno)
           
 JsContext getContext(int depth)
           
 int getContextCount()
           
 JsCallbacks getDebugger()
          Return the current debugger.
 java.lang.Object getDebugInterface()
           
 DocumentCell getDocumentCell(java.lang.String name)
           
 JsObject getGlobalObject()
           
 RhinoContextProxy getRhinoContextProxy()
           
 java.lang.String getThread()
           
 java.lang.String getThreadGroup()
           
 JsObject getUndefinedValue()
           
 void handleBreakpointHit(org.mozilla.javascript.Context cx)
           
 void handleCompilationDone(org.mozilla.javascript.Context cx, org.mozilla.javascript.debug.DebuggableScript fnOrScript, java.lang.StringBuffer source)
           
 void handleExceptionThrown(org.mozilla.javascript.Context cx, java.lang.Object exceptionThrown)
           
 DocumentCell loadDocumentNotify(java.lang.String name)
           
 void placeBreakpointAtLine(int brkptid, java.lang.String docname, int lineno)
           
 void placeBreakpointAtOffset(int brkptid, java.lang.String docname, int offset)
           
 void removeBreakpoint(java.lang.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(java.lang.String docname, boolean on)
           
 void stepIn(JsEngineStub eng)
           
 void stepOut(JsEngineStub eng)
           
 void stepOver(JsEngineStub eng)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mozilla.javascript.debug.Debugger
getFrame, handleCompilationDone
 

Constructor Detail

RhinoEngineDebugger

public RhinoEngineDebugger(JavaScriptEngine eng)
                    throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException
Method Detail

disconnectedDebuggerNotify

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


getDocumentCell

public DocumentCell getDocumentCell(java.lang.String name)

loadDocumentNotify

public DocumentCell loadDocumentNotify(java.lang.String name)

placeBreakpointAtLine

public void placeBreakpointAtLine(int brkptid,
                                  java.lang.String docname,
                                  int lineno)

placeBreakpointAtOffset

public void placeBreakpointAtOffset(int brkptid,
                                    java.lang.String docname,
                                    int offset)

removeBreakpoint

public void removeBreakpoint(java.lang.String docname,
                             int brkptid)
                      throws BSFException
Throws:
BSFException

setEntryExit

public void setEntryExit(java.lang.String docname,
                         boolean on)
                  throws BSFException
Throws:
BSFException

eval

public java.lang.Object eval(java.lang.String docname,
                             java.lang.String fnOrScript,
                             int lineno)
                      throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

getContext

public JsContext getContext(int depth)

getContextCount

public int getContextCount()

getDebugger

public JsCallbacks getDebugger()
Return the current debugger.

Returns:
the debugger, or null if none is attached.

getDebugInterface

public java.lang.Object getDebugInterface()

getGlobalObject

public JsObject getGlobalObject()

getRhinoContextProxy

public RhinoContextProxy getRhinoContextProxy()

getUndefinedValue

public JsObject getUndefinedValue()

getThread

public java.lang.String getThread()

getThreadGroup

public java.lang.String getThreadGroup()

handleBreakpointHit

public void handleBreakpointHit(org.mozilla.javascript.Context cx)

_handleBreakpointHit

public void _handleBreakpointHit(DocumentCell cell,
                                 int lineno)

run

public void run(JsEngineStub eng)
         throws java.lang.Exception
Throws:
java.lang.Exception

stepIn

public void stepIn(JsEngineStub eng)
            throws java.lang.Exception
Throws:
java.lang.Exception

stepOut

public void stepOut(JsEngineStub eng)
             throws java.lang.Exception
Throws:
java.lang.Exception

stepOver

public void stepOver(JsEngineStub eng)
              throws java.lang.Exception
Throws:
java.lang.Exception

handleCompilationDone

public void handleCompilationDone(org.mozilla.javascript.Context cx,
                                  org.mozilla.javascript.debug.DebuggableScript fnOrScript,
                                  java.lang.StringBuffer source)

handleExceptionThrown

public void handleExceptionThrown(org.mozilla.javascript.Context cx,
                                  java.lang.Object exceptionThrown)

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.