org.apache.bsf.debug.meta
Class JsEngineStub

java.lang.Object
  extended by org.apache.bsf.debug.util.Stub
      extended by org.apache.bsf.debug.meta.JsEngineStub
All Implemented Interfaces:
java.rmi.Remote, JsEngine, RemoteService

public class JsEngineStub
extends Stub
implements JsEngine


Field Summary
 
Fields inherited from class org.apache.bsf.debug.util.Stub
m_con, m_revoked, m_tid, m_uid, NOT_FOUND, UNDEFINED
 
Constructor Summary
JsEngineStub(SocketConnection con, int tid, int uid)
           
 
Method Summary
 java.lang.Object eval(java.lang.String docname, java.lang.String fnOrScript, int lineno)
          Allow the debugger to evaluate an expression within the current context.
 JsContext getContext(int depth)
          Returns the JsContext at a certain depth.
 int getContextCount()
          Returns the count of JsContext on the current stack.
 JsCallbacks getDebugger()
          Return the current debugger.
 JsObject getGlobalObject()
          Any execution in JavaScript happen with respect to a global object, sort of the top-level name space for properties.
 java.lang.String getThread()
          Returns name of the thread currently running in the engine
 java.lang.String getThreadGroup()
          Returns name of the ThreadGroup of the thread currently running in the engine
 JsObject getUndefinedValue()
          As per ECMA specification, each JavaScript execution defines a unique object for the undefined value.
 boolean isSuspended()
           
 boolean poll()
          Allows the client debugger to poll the connection.
 void run()
          Stepping commands: run: resume execution until it finishes or a breakpoint is hit.
 void setDebugger(JsCallbacks debugger)
          Set the associated debugger.
 void stepIn()
           
 void stepOut()
           
 void stepOver()
           
 
Methods inherited from class org.apache.bsf.debug.util.Stub
addListener, completeFuture, createFuture, equals, getConnection, getTid, getUid, Init, removeListener, revoked, revokeFuture, suspendFuture, swizzle
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsEngineStub

public JsEngineStub(SocketConnection con,
                    int tid,
                    int uid)
Method Detail

poll

public boolean poll()
             throws java.rmi.RemoteException
Description copied from interface: JsEngine
Allows the client debugger to poll the connection.

Specified by:
poll in interface JsEngine
Throws:
java.rmi.RemoteException

setDebugger

public void setDebugger(JsCallbacks debugger)
                 throws java.rmi.RemoteException
Set the associated debugger.

Specified by:
setDebugger in interface JsEngine
Parameters:
debugger - the debugger to be used on callbacks from the engine.
Throws:
java.rmi.RemoteException

getDebugger

public JsCallbacks getDebugger()
                        throws java.rmi.RemoteException
Return the current debugger.

Specified by:
getDebugger in interface JsEngine
Returns:
the debugger, or null if none is attached.
Throws:
java.rmi.RemoteException

eval

public java.lang.Object eval(java.lang.String docname,
                             java.lang.String fnOrScript,
                             int lineno)
                      throws java.rmi.RemoteException
Allow the debugger to evaluate an expression within the current context.

Specified by:
eval in interface JsEngine
Throws:
java.rmi.RemoteException

getContextCount

public int getContextCount()
                    throws java.rmi.RemoteException
Returns the count of JsContext on the current stack. This is a valid call only if the engine is stopped in a callback to the debugger (breakpoint or stepping completed).

Specified by:
getContextCount in interface JsEngine
Throws:
java.rmi.RemoteException

getThread

public java.lang.String getThread()
                           throws java.rmi.RemoteException
Description copied from interface: JsEngine
Returns name of the thread currently running in the engine

Specified by:
getThread in interface JsEngine
Throws:
java.rmi.RemoteException

getThreadGroup

public java.lang.String getThreadGroup()
                                throws java.rmi.RemoteException
Description copied from interface: JsEngine
Returns name of the ThreadGroup of the thread currently running in the engine

Specified by:
getThreadGroup in interface JsEngine
Throws:
java.rmi.RemoteException

getContext

public JsContext getContext(int depth)
                     throws java.rmi.RemoteException
Returns the JsContext at a certain depth. Depth zero is the top of the stack, that is, the inner execution context. This is a valid call only if the engine is stopped in a callback to the debugger (breakpoint or stepping completed).

Specified by:
getContext in interface JsEngine
Throws:
java.rmi.RemoteException

getGlobalObject

public JsObject getGlobalObject()
                         throws java.rmi.RemoteException
Any execution in JavaScript happen with respect to a global object, sort of the top-level name space for properties. This is global object return by this call.

Specified by:
getGlobalObject in interface JsEngine
Throws:
java.rmi.RemoteException

getUndefinedValue

public JsObject getUndefinedValue()
                           throws java.rmi.RemoteException
As per ECMA specification, each JavaScript execution defines a unique object for the undefined value.

Specified by:
getUndefinedValue in interface JsEngine
Throws:
java.rmi.RemoteException

run

public void run()
         throws java.rmi.RemoteException
Stepping commands: run: resume execution until it finishes or a breakpoint is hit. stepIn: steps to the next statement, considering callee's statement if any. stepOut: steps until the current JsContext exits. stepOver: steps to the next statement within the same JsContext.

Specified by:
run in interface JsEngine
Throws:
java.rmi.RemoteException

stepIn

public void stepIn()
            throws java.rmi.RemoteException
Specified by:
stepIn in interface JsEngine
Throws:
java.rmi.RemoteException

stepOut

public void stepOut()
             throws java.rmi.RemoteException
Specified by:
stepOut in interface JsEngine
Throws:
java.rmi.RemoteException

stepOver

public void stepOver()
              throws java.rmi.RemoteException
Specified by:
stepOver in interface JsEngine
Throws:
java.rmi.RemoteException

isSuspended

public boolean isSuspended()
Specified by:
isSuspended in interface JsEngine