org.apache.bsf.util

Class BSFDebugManagerImpl

public class BSFDebugManagerImpl extends Skeleton implements BSFDebugManager, RemoteServiceListener

Constructor Summary
BSFDebugManagerImpl()
Method Summary
voidfinalize()
StringgetLangFromFilename(String fileName)
Determine the language of a script file by looking at the file extension.
booleanisLanguageRegistered(String lang)
Determine whether a language is registered.
DocumentCellloadDocumentNotify(BSFEngine eng, String name)
voidplaceBreakpointAtLine(int brkptid, String docname, int lineno)
voidplaceBreakpointAtOffset(int brkptid, String docname, int offset)
voidregisterDebugger(String lang, BSFDebugger debugger)
Register a debugger for a scripting engine.
voidregisterEngine(BSFManager mger, BSFEngine eng, String lang)
voidregisterManager(BSFManager mger)
voidremoveAllBreakpoints()
voidremoveBreakpoint(String docname, int brkptid)
voidrevokedNotify(RemoteService service)
Callback from the socket/stub layer.
voidsetEntryExit(String docname, boolean on)
booleansupportBreakpointAtLine(String lang)
booleansupportBreakpointAtOffset(String lang)
Allows a debugger to ask if the engine for a given language will support either line or offset breakpoints.
voidterminate()
voidterminateEngineNotify(BSFManager mger, BSFEngine eng, String lang)
voidterminateManagerNotify(BSFManager mger)
voidunregisterDebugger(String lang)

Constructor Detail

BSFDebugManagerImpl

public BSFDebugManagerImpl()

Method Detail

finalize

public void finalize()

getLangFromFilename

public String getLangFromFilename(String fileName)
Determine the language of a script file by looking at the file extension.

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: RemoteException if file's extension is unknown.

isLanguageRegistered

public boolean isLanguageRegistered(String lang)
Determine whether a language is registered.

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)

placeBreakpointAtOffset

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

registerDebugger

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

Parameters: lang string identifying language

Throws: 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.

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)

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.

setEntryExit

public void setEntryExit(String docname, boolean on)

supportBreakpointAtLine

public boolean supportBreakpointAtLine(String lang)

supportBreakpointAtOffset

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

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)