org.apache.bsf.debug.meta
Class DebugManagerStub

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

public class DebugManagerStub
extends Stub
implements BSFDebugManager


Field Summary
protected  java.util.Vector fEngines
           
 
Fields inherited from class org.apache.bsf.debug.util.Stub
m_con, m_revoked, m_tid, m_uid, NOT_FOUND, UNDEFINED
 
Constructor Summary
DebugManagerStub(SocketConnection con)
           
 
Method Summary
 void disconnectNotify(java.lang.Exception ex)
          A communication error occured, simply disconnect and therefore clean everything up.
 java.lang.String getLangFromFilename(java.lang.String fileName)
          Determine the language of a script file by looking at the file extension.
 boolean isLanguageRegistered(java.lang.String lang)
          Determine whether a language is registered.
 void placeBreakpointAtLine(int bpid, java.lang.String docname, int lineno)
          Breakpoints are placed within documents either at a specific line or offset.
 void placeBreakpointAtOffset(int bpid, java.lang.String docname, int offset)
           
 void registerDebugger(java.lang.String lang, BSFDebugger debugger)
          Register a debugger for a scripting engine.
 void removeBreakpoint(java.lang.String docname, int bpid)
          Allows to remove a breakpoint.
 void sendQuitNotice()
           
 void setEntryExit(java.lang.String docname, boolean on)
          Allows setting entry/exit mode
 boolean supportBreakpointAtLine(java.lang.String lang)
           
 boolean supportBreakpointAtOffset(java.lang.String lang)
          Allows a debugger to ask if the engine for a given language will support either line or offset breakpoints.
 void unregisterDebugger(java.lang.String lang)
           
 
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
 

Field Detail

fEngines

protected java.util.Vector fEngines
Constructor Detail

DebugManagerStub

public DebugManagerStub(SocketConnection con)
                 throws java.io.IOException
Throws:
java.io.IOException
Method Detail

disconnectNotify

public void disconnectNotify(java.lang.Exception ex)
A communication error occured, simply disconnect and therefore clean everything up.


sendQuitNotice

public void sendQuitNotice()
                    throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

getLangFromFilename

public java.lang.String getLangFromFilename(java.lang.String fileName)
                                     throws java.rmi.RemoteException
Determine the language of a script file by looking at the file extension.

Specified by:
getLangFromFilename in interface BSFDebugManager
Parameters:
filename - the name of the file
Returns:
the scripting language the file is in if the file extension is known to me (must have been registered via registerScriptingEngine).
Throws:
java.rmi.RemoteException - if file's extension is unknown.

isLanguageRegistered

public boolean isLanguageRegistered(java.lang.String lang)
                             throws java.rmi.RemoteException
Determine whether a language is registered.

Specified by:
isLanguageRegistered in interface BSFDebugManager
Parameters:
lang - string identifying a language
Returns:
true iff it is
Throws:
java.rmi.RemoteException

placeBreakpointAtLine

public void placeBreakpointAtLine(int bpid,
                                  java.lang.String docname,
                                  int lineno)
                           throws java.rmi.RemoteException
Breakpoints are placed within documents either at a specific line or offset. While breakpoints can be set at lines and offsets in the same document, there is no conversions between lines and offsets. Some engines may support only offsets or only lines and therefore some breakpoints may be ignored. Placing a breakpoint is local to a debugger connection. In other words, breakpoints set by other debuggers are not visible to a given debugger. Breakpoints are given identifiers so to make easier for debuggers to manipulate breakpoints. Identifiers are allocated by the debugger; they must be unique for the entire session between that debugger and the debug manager.

Specified by:
placeBreakpointAtLine in interface BSFDebugManager
Throws:
java.rmi.RemoteException

placeBreakpointAtOffset

public void placeBreakpointAtOffset(int bpid,
                                    java.lang.String docname,
                                    int offset)
                             throws java.rmi.RemoteException
Specified by:
placeBreakpointAtOffset in interface BSFDebugManager
Throws:
java.rmi.RemoteException

removeBreakpoint

public void removeBreakpoint(java.lang.String docname,
                             int bpid)
                      throws java.rmi.RemoteException
Allows to remove a breakpoint.

Specified by:
removeBreakpoint in interface BSFDebugManager
Throws:
java.rmi.RemoteException

setEntryExit

public void setEntryExit(java.lang.String docname,
                         boolean on)
                  throws java.rmi.RemoteException
Allows setting entry/exit mode

Specified by:
setEntryExit in interface BSFDebugManager
Throws:
java.rmi.RemoteException

supportBreakpointAtOffset

public boolean supportBreakpointAtOffset(java.lang.String lang)
                                  throws java.rmi.RemoteException
Allows a debugger to ask if the engine for a given language will support either line or offset breakpoints. Note: this will most likely provoke the loading of the engine.

Specified by:
supportBreakpointAtOffset in interface BSFDebugManager
Throws:
java.rmi.RemoteException

supportBreakpointAtLine

public boolean supportBreakpointAtLine(java.lang.String lang)
                                throws java.rmi.RemoteException
Specified by:
supportBreakpointAtLine in interface BSFDebugManager
Throws:
java.rmi.RemoteException

registerDebugger

public void registerDebugger(java.lang.String lang,
                             BSFDebugger debugger)
                      throws java.rmi.RemoteException
Register a debugger for a scripting engine.

Specified by:
registerDebugger in interface BSFDebugManager
Parameters:
lang - string identifying language
Throws:
java.rmi.RemoteException - if the language is unknown (i.e., if it has not been registered) with a reason of REASON_UNKNOWN_LANGUAGE. If the language is known but if the interface can't be created for some reason, then the reason is set to REASON_OTHER_ERROR and the actual exception is passed on as well.

unregisterDebugger

public void unregisterDebugger(java.lang.String lang)
                        throws java.rmi.RemoteException
Specified by:
unregisterDebugger in interface BSFDebugManager
Throws:
java.rmi.RemoteException