protected class ReceiverTorso.CommandHandler extends Thread
ReceiverTorso.rmiCommand(stella.CommandEvent), the
actual
command handling is done with a seperate class that is an extension to
Thread. It is constructed with the incomming command so multiple calls
to the outer classe's ReceiverTorso.rmiCommand(stella.CommandEvent) will not result in
errors.
The only use of the command-processing as an inner class is to allow
multiple, thread-safe command calls.Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
private CommandEvent |
cmd
The command to process.
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Modifier | Constructor and Description |
|---|---|
protected |
CommandHandler(ThreadGroup group,
CommandEvent com)
Constructs a new command-handling thread.
|
| Modifier and Type | Method and Description |
|---|---|
void |
run()
The run method of the receiver.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldprivate final CommandEvent cmd
protected CommandHandler(ThreadGroup group, CommandEvent com)
group - The thread group this command handler should run in.cmd - The command to process.public void run()
ReceiverTorso.getAcknowledgeNumber(stella.CommandEvent). As long as
calls to the ReceiverTorso.processCommand(stella.CommandEvent, int) returns true the
acknowledge number is reduced until the
AcknowledgeEvent.PRIMARY_ACK is reached and a final done
event
is sent. If a call to ReceiverTorso.processCommand(stella.CommandEvent, int) returns false
this acknowledge chaining is broken: The error event is fetched with
ReceiverTorso.getLastError(stella.CommandEvent), sent back to the error listeners, and the
command caster is notified with a final, successful, done event
(Note that unsuccessful done events are spared for
unexpected errors
that have no individual error handling procedure).