org.apache.bsf.util

Class BSFDebugManagerImpl

Implemented Interfaces:
BSFDebugManager, Remote, RemoteServiceListener

public class BSFDebugManagerImpl
extends Skeleton
implements BSFDebugManager, RemoteServiceListener

Constructor Summary

BSFDebugManagerImpl()

Method Summary

void
finalize()
String
getLangFromFilename(String fileName)
Determine the language of a script file by looking at the file extension.
boolean
isLanguageRegistered(String lang)
Determine whether a language is registered.
DocumentCell
loadDocumentNotify(BSFEngine eng, String name)
void
placeBreakpointAtLine(int brkptid, String docname, int lineno)
void
placeBreakpointAtOffset(int brkptid, String docname, int offset)
void
registerDebugger(String lang, BSFDebugger debugger)
Register a debugger for a scripting engine.
void
registerEngine(BSFManager mger, BSFEngine eng, String lang)
void
registerManager(BSFManager mger)
void
removeAllBreakpoints()
void
removeBreakpoint(String docname, int brkptid)
void
revokedNotify(RemoteService service)
Callback from the socket/stub layer.
void
setEntryExit(String docname, boolean on)
boolean
supportBreakpointAtLine(String lang)
boolean
supportBreakpointAtOffset(String lang)
Allows a debugger to ask if the engine for a given language will support either line or offset breakpoints.
void
terminate()
void
terminateEngineNotify(BSFManager mger, BSFEngine eng, String lang)
void
terminateManagerNotify(BSFManager mger)
void
unregisterDebugger(String lang)

Methods inherited from class org.apache.bsf.debug.util.Skeleton

addListener, allocOid, completeFuture, createFuture, equals, getTid, getUid, hasNoUid, removeListener, suspendFuture

Constructor Details

BSFDebugManagerImpl

public BSFDebugManagerImpl()
            throws RemoteException

Method Details

finalize

public void finalize()

getLangFromFilename

public String getLangFromFilename(String fileName)
            throws RemoteException
Determine the language of a script file by looking at the file extension.
Specified by:
getLangFromFilename in interface BSFDebugManager
Parameters:
Returns:
the scripting language the file is in if the file extension is known to me (must have been registered via registerScriptingEngine).

isLanguageRegistered

public boolean isLanguageRegistered(String lang)
Determine whether a language is registered.
Specified by:
isLanguageRegistered in interface BSFDebugManager
Parameters:
lang - string identifying a language
Returns:
true iff it is

loadDocumentNotify

public DocumentCell loadDocumentNotify(BSFEngine eng,
                                       String name)

placeBreakpointAtLine

public void placeBreakpointAtLine(int brkptid,
                                  String docname,
                                  int lineno)
            throws RemoteException
Specified by:
placeBreakpointAtLine in interface BSFDebugManager

placeBreakpointAtOffset

public void placeBreakpointAtOffset(int brkptid,
                                    String docname,
                                    int offset)
            throws RemoteException
Specified by:
placeBreakpointAtOffset in interface BSFDebugManager

registerDebugger

public void registerDebugger(String lang,
                             BSFDebugger debugger)
            throws RemoteException
Register a debugger for a scripting engine.
Specified by:
registerDebugger in interface BSFDebugManager
Parameters:
lang - string identifying language

registerEngine

public void registerEngine(BSFManager mger,
                           BSFEngine eng,
                           String lang)

registerManager

public void registerManager(BSFManager mger)

removeAllBreakpoints

public void removeAllBreakpoints()

removeBreakpoint

public void removeBreakpoint(String docname,
                             int brkptid)
            throws RemoteException
Specified by:
removeBreakpoint in interface BSFDebugManager

revokedNotify

public void revokedNotify(RemoteService service)
Callback from the socket/stub layer. A stub for a remote debugger is being revoked due to a lost connection. Since we support only one debuggers from only one JVM, there is only one connection and therefore we can drop all debuggers... and then drop all breakpoints. ATTENTION: Breakpoints shall not be dropped if we extend this implementation to multiple debuggers through multiple socket connections.
Specified by:
revokedNotify in interface RemoteServiceListener

setEntryExit

public void setEntryExit(String docname,
                         boolean on)
            throws RemoteException
Specified by:
setEntryExit in interface BSFDebugManager

supportBreakpointAtLine

public boolean supportBreakpointAtLine(String lang)
            throws RemoteException
Specified by:
supportBreakpointAtLine in interface BSFDebugManager

supportBreakpointAtOffset

public boolean supportBreakpointAtOffset(String lang)
            throws 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

terminate

public void terminate()

terminateEngineNotify

public void terminateEngineNotify(BSFManager mger,
                                  BSFEngine eng,
                                  String lang)

terminateManagerNotify

public void terminateManagerNotify(BSFManager mger)

unregisterDebugger

public void unregisterDebugger(String lang)
            throws RemoteException
Specified by:
unregisterDebugger in interface BSFDebugManager