|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BSFDebugManager
Debug Manager. This is a service for remote debuggers to gain access to remote debugging services on language engines. Currently, there is only one debugger supported per engine. However, multiple debuggers may register for different engines. There may be more than one engine per language given than more than one BSFManager can be instanciated within a Java virtual machine. Each debugger (instance of BSFDebugger) should first register itself to a debug manager running in the Java virtual machine in which debugging is intended. A debugger registers for a specific language, such as JavaScript. As a consequence of registration, the debugger will be notified of already existing engines as well as any future creation or termination of engines for the relevant language. Upon this notification, the debugger can ask the engine for its language-specific debugging interface and then register the debugger callbacks for debugging events. See org.apache.bsf.debug.jsdi.Callbacks for the JavaScript example. The debugging framework works on the concept of documents and breakpoints. A document is basically a container for scripts (be them functions, expressions, or actual scripts). These scripts are subsets of the document. Documents are declared to the BSFEngine when evaluating or executing some scripts. Scripts are defined as a range, either line or character range in their document. Correspondingly, breakpoints can be set at lines or offsets in a document. The line numbers and offsets are global numbers with respect to the entire document. So for instance, in a JSP with JavaScript, the document is the JSP file. The scripts are the tags containing JavaScript code. The Jasper compiler extracts the scripts from the JSP and produces a Servlet that will provide these scripts to the BSF JavaScript engine at execution time. Each of these scripts start at a given line, offsets are not supported. Breakpoints can therefore be set at lines belonging to these JavaScript scripts, considering line numbers at the document level, that is, the entire JSP file.
Method Summary | |
---|---|
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 brkptid)
Allows to remove a breakpoint. |
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)
|
Method Detail |
---|
java.lang.String getLangFromFilename(java.lang.String fileName) throws java.rmi.RemoteException
filename
- the name of the file
BSFException
- if file's extension is unknown.
java.rmi.RemoteException
boolean isLanguageRegistered(java.lang.String lang) throws java.rmi.RemoteException
lang
- string identifying a language
java.rmi.RemoteException
void placeBreakpointAtLine(int bpid, java.lang.String docname, int lineno) throws java.rmi.RemoteException
java.rmi.RemoteException
void placeBreakpointAtOffset(int bpid, java.lang.String docname, int offset) throws java.rmi.RemoteException
java.rmi.RemoteException
void removeBreakpoint(java.lang.String docname, int brkptid) throws java.rmi.RemoteException
java.rmi.RemoteException
void setEntryExit(java.lang.String docname, boolean on) throws java.rmi.RemoteException
java.rmi.RemoteException
boolean supportBreakpointAtOffset(java.lang.String lang) throws java.rmi.RemoteException
java.rmi.RemoteException
boolean supportBreakpointAtLine(java.lang.String lang) throws java.rmi.RemoteException
java.rmi.RemoteException
void registerDebugger(java.lang.String lang, BSFDebugger debugger) throws java.rmi.RemoteException
lang
- string identifying language
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.void unregisterDebugger(java.lang.String lang) throws java.rmi.RemoteException
java.rmi.RemoteException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |