| Method from org.apache.bsf.debug.meta.DebugManagerStub Detail: |
public void disconnectNotify(Exception ex) {
fEngines = new Vector();
}
A communication error occured, simply disconnect
and therefore clean everything up. |
void engineCreateNotify(JsEngineStub eng) {
fEngines.addElement(eng);
}
|
public String getLangFromFilename(String fileName) throws RemoteException {
ResultCell cell;
try {
cell = m_con.prepareOutgoingInvoke(this, DebugConstants.BSF_DEBUG_MANAGER_TID, DebugConstants.DM_GET_LANG_FROM_FILENAME);
cell.writeObject(fileName);
return (String) cell.waitForValueObject();
}
catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
}
catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
Determine the language of a script file by looking at the file
extension. |
public boolean isLanguageRegistered(String lang) throws RemoteException {
ResultCell cell=null;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.BSF_DEBUG_MANAGER_TID,DebugConstants.DM_IS_LANGUAGE_REGISTERED);
cell.writeObject(lang);
return cell.waitForBooleanValue();
}
catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
}
catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
Determine whether a language is registered. |
public void placeBreakpointAtLine(int bpid,
String docname,
int lineno) throws RemoteException {
ResultCell cell=null;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.BSF_DEBUG_MANAGER_TID,DebugConstants.DM_PLACE_BREAKPOINT_AT_LINE);
cell.writeInt(bpid);
cell.writeObject(docname);
cell.writeInt(lineno);
cell.waitForCompletion();
}
catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
}
catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
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. |
public void placeBreakpointAtOffset(int bpid,
String docname,
int offset) throws RemoteException {
throw new Error("FYI");
}
|
public void registerDebugger(String lang,
BSFDebugger debugger) throws RemoteException {
ResultCell cell;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.BSF_DEBUG_MANAGER_TID,DebugConstants.DM_REGISTER_DEBUGGER_FOR_LANG);
cell.writeObject(lang);
cell.writeObject(debugger);
cell.waitForCompletion();
}
catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
}
catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
Register a debugger for a scripting engine. |
public void removeBreakpoint(String docname,
int bpid) throws RemoteException {
ResultCell cell;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.BSF_DEBUG_MANAGER_TID, DebugConstants.DM_REMOVE_BREAKPOINT);
cell.writeObject(docname);
cell.writeInt(bpid);
cell.waitForCompletion();
}
catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
}
catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
Allows to remove a breakpoint. |
public void sendQuitNotice() throws RemoteException {
ResultCell cell = null;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.BSF_DEBUG_MANAGER_TID,DebugConstants.DM_QUIT_NOTIFY);
cell.writeInt(0);
cell.waitForCompletion();
}
catch (Exception ex) {
throw new RemoteException("Error sending quit notice.", ex);
}
}
|
public void setEntryExit(String docname,
boolean on) throws RemoteException {
ResultCell cell;
int int_on = (on) ? 1 : 0;
try {
cell = m_con.prepareOutgoingInvoke(this,DebugConstants.BSF_DEBUG_MANAGER_TID, DebugConstants.DM_SET_ENTRY_EXIT);
cell.writeObject(docname);
cell.writeInt(int_on);
cell.waitForCompletion();
}
catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
}
catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
Allows setting entry/exit mode |
public boolean supportBreakpointAtLine(String lang) throws RemoteException {
return true;
}
|
public boolean supportBreakpointAtOffset(String lang) throws RemoteException {
return false;
}
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. |
public void unregisterDebugger(String lang) throws RemoteException {
ResultCell cell;
try {
cell = m_con.prepareOutgoingInvoke(this, DebugConstants.BSF_DEBUG_MANAGER_TID,DebugConstants.DM_UNREGISTER_DEBUGGER_FOR_LANG);
cell.writeObject(lang);
cell.waitForCompletion();
}
catch (IOException ex) {
throw new RemoteException("Marshalling error", ex);
}
catch (Exception ex) {
throw new RemoteException("Error at server", ex);
}
}
|