|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--jde.debugger.Jdebug
Class of JDEbug debuggers.
This class defines methods for communicating with the JDE. It maintains a list of active applications. It passes application commands to the apps specified by the commands.
See Protocol class
for command/response formats and
EventHandler
for event set formats.
JDEbug responds to every command with either a result or error message.
Field Summary | |
(package private) java.util.Map |
applications
Registry of active applications. |
static java.lang.Integer |
debuggerID
The ID of jdebug. |
(package private) java.io.BufferedReader |
in
FIELDS * |
(package private) java.io.PrintWriter |
out
|
private java.util.Collection |
pendingCommands
Each command has a command id associated with it, that is used by jde, to match with the corresponding result/error. |
static Jdebug |
theDebugger
|
Fields inherited from class java.lang.Thread |
contextClassLoader, daemon, eetop, group, inheritableThreadLocals, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadLocals, threadQ |
Constructor Summary | |
protected |
Jdebug()
CONSTRUCTORS * |
Method Summary | |
void |
addApplication(java.lang.Integer appID,
Application app)
|
void |
addPendingCommand(java.lang.Integer cmdID)
|
boolean |
appExists(java.lang.Integer appID)
|
Application |
getApplication(java.lang.Integer appID)
|
private void |
handleAppCommand(java.lang.Integer app_id,
java.lang.Integer cmd_id,
java.lang.String command,
java.util.List arguments)
Commands received from Jdebug that don't have app_id == -1 get funneled to handleAppCommand. |
void |
init()
|
boolean |
pendingCmdExists(java.lang.Integer cmdID)
|
void |
removeApplication(java.lang.Integer app_id)
called by Application.shutdown()
to remove it's own entry from
the applications collection here |
void |
removePendingCommand(java.lang.Integer cmdID)
|
void |
run()
Runs the debugger thread. |
private void |
setSyntax(java.io.StreamTokenizer st)
Sets the syntax of the input stream. |
void |
shutdown()
Shuts down all the applications prior to exiting |
void |
signal(java.lang.Integer app_id,
java.lang.String type,
java.lang.Object obj)
Send an arbitrary lisp function across. |
void |
signalCommandError(java.lang.Integer app_id,
java.lang.Integer cmd_id,
java.lang.Object obj)
reply to a command with an error. |
void |
signalCommandResult(java.lang.Integer app_id,
java.lang.Integer cmd_id)
send the result of a command. |
void |
signalCommandResult(java.lang.Integer app_id,
java.lang.Integer cmd_id,
java.lang.Object obj)
the result of a command. |
void |
signalDebug(java.lang.String msg)
|
private void |
signalReply(java.lang.Integer app_id,
java.lang.Integer cmd_id,
java.lang.Object obj,
java.lang.String type)
Signal a reply: a result or an error |
java.lang.String |
stringRep(java.lang.Object obj)
Returns a string representation of the object. |
Methods inherited from class java.lang.Thread |
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
java.io.BufferedReader in
java.io.PrintWriter out
java.util.Map applications
private java.util.Collection pendingCommands
Application
, see
Application.pendingCommands
),
and removes
them once the command processing is over.Note that in case the command is actually meant for one of the apps (ie as ascertained by matching the app_id), the id isn't stored in our Collection, but the applications. This means that, in fact, it is the tuple (app_id, cmd_id) that need be unique (assuming that a "general" command has a app_id of -1
public static final java.lang.Integer debuggerID
public static Jdebug theDebugger
Constructor Detail |
protected Jdebug()
Method Detail |
public void init() throws java.io.IOException
private void setSyntax(java.io.StreamTokenizer st)
public void run()
run
in class java.lang.Thread
java.lang.Thread
Thread.start()
,
Thread.stop()
,
Thread.Thread(java.lang.ThreadGroup,
java.lang.Runnable, java.lang.String)
,
Runnable.run()
private void handleAppCommand(java.lang.Integer app_id, java.lang.Integer cmd_id, java.lang.String command, java.util.List arguments)
app_id
- The ID of the app this command targetscmd_id
- ID of the commandcommand
- the commandarguments
- command argumentspublic void addApplication(java.lang.Integer appID, Application app)
public void removeApplication(java.lang.Integer app_id)
Application.shutdown()
to remove it's own entry from
the applications collection herepublic boolean appExists(java.lang.Integer appID)
public Application getApplication(java.lang.Integer appID)
public void addPendingCommand(java.lang.Integer cmdID)
public void removePendingCommand(java.lang.Integer cmdID)
public boolean pendingCmdExists(java.lang.Integer cmdID)
public void shutdown() throws JDEException
public java.lang.String stringRep(java.lang.Object obj)
public void signal(java.lang.Integer app_id, java.lang.String type, java.lang.Object obj)
app_id
- The application IDtype
- The function name. JDE_BUG gets added to
its beginningobj
- An arbitrary object. If a string, it's just printed out,
if a list, each of its elements is printed out, with a space after
each.private void signalReply(java.lang.Integer app_id, java.lang.Integer cmd_id, java.lang.Object obj, java.lang.String type)
public void signalCommandResult(java.lang.Integer app_id, java.lang.Integer cmd_id)
public void signalDebug(java.lang.String msg)
public void signalCommandResult(java.lang.Integer app_id, java.lang.Integer cmd_id, java.lang.Object obj)
public void signalCommandError(java.lang.Integer app_id, java.lang.Integer cmd_id, java.lang.Object obj)
obj
- Is usually a string explaining what went wrong.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |