org.apache.bsf.debug.meta

Class DebugManagerStub

Implemented Interfaces:
BSFDebugManager, Remote, RemoteService

public class DebugManagerStub
extends Stub
implements BSFDebugManager

Field Summary

protected Vector
fEngines

Fields inherited from class org.apache.bsf.debug.util.Stub

NOT_FOUND, UNDEFINED, m_con, m_revoked, m_tid, m_uid

Constructor Summary

DebugManagerStub(SocketConnection con)

Method Summary

void
disconnectNotify(Exception ex)
A communication error occured, simply disconnect and therefore clean everything up.
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.
void
placeBreakpointAtLine(int bpid, String docname, int lineno)
Breakpoints are placed within documents either at a specific line or offset.
void
placeBreakpointAtOffset(int bpid, String docname, int offset)
void
registerDebugger(String lang, BSFDebugger debugger)
Register a debugger for a scripting engine.
void
removeBreakpoint(String docname, int bpid)
Allows to remove a breakpoint.
void
sendQuitNotice()
void
setEntryExit(String docname, boolean on)
Allows setting entry/exit mode
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
unregisterDebugger(String lang)

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

Init, addListener, completeFuture, createFuture, equals, getConnection, getTid, getUid, removeListener, revokeFuture, revoked, suspendFuture, swizzle

Field Details

fEngines

protected Vector fEngines

Constructor Details

DebugManagerStub

public DebugManagerStub(SocketConnection con)
            throws IOException

Method Details

disconnectNotify

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

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)
            throws RemoteException
Determine whether a language is registered.
Specified by:
isLanguageRegistered in interface BSFDebugManager
Parameters:
lang - string identifying a language
Returns:
true iff it is

placeBreakpointAtLine

public void placeBreakpointAtLine(int bpid,
                                  String docname,
                                  int lineno)
            throws 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

placeBreakpointAtOffset

public void placeBreakpointAtOffset(int bpid,
                                    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

removeBreakpoint

public void removeBreakpoint(String docname,
                             int bpid)
            throws RemoteException
Allows to remove a breakpoint.
Specified by:
removeBreakpoint in interface BSFDebugManager

sendQuitNotice

public void sendQuitNotice()
            throws RemoteException

setEntryExit

public void setEntryExit(String docname,
                         boolean on)
            throws RemoteException
Allows setting entry/exit mode
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

unregisterDebugger

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