org.apache.bsf.debug
public interface: BSFDebugManager [javadoc |
source]
All Implemented Interfaces:
Remote
All Known Implementing Classes:
BSFDebugManagerImpl, DebugManagerStub
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.