stella
Class MasterLauncher.MasterHelper
java.lang.Object
java.lang.Thread
stella.MasterLauncher.MasterHelper
- All Implemented Interfaces:
- Runnable
- Enclosing class:
- MasterLauncher
protected class MasterLauncher.MasterHelper
- extends Thread
The master launcher helper thread. This thread is responsible for
checking replies registered to the incomming command (and sending
them back accordingly), as well as calling the imbedding class's
MasterLauncher.processCommand(stella.CommandEvent) method. It acts as a thread to allow fast
return from the MasterLauncher.castCommand(stella.CommandEvent) method.
|
Method Summary |
private void |
checkForward(String type)
Checks the embedding's reply pattern list for a match to a reply
event constructed from the type handed over and the command event
registered. |
void |
run()
The run method of the master helper. |
| Methods inherited from class java.lang.Thread |
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, yield |
cmd
private CommandEvent cmd
- The command to process.
MasterLauncher.MasterHelper
protected MasterLauncher.MasterHelper(CommandEvent process)
- Constructs a new master helper thread. Starting of the thread must
be done within the calling method.
run
public void run()
- The run method of the master helper. This method does the following:
- If a reply subscriber is registered at the embedding class,
the received command is checked for an acknowledge type 1 event
registed in the forward pattern list. If a match is found an
appropriate acknowledge event is forwarded to the subscriber and
the match is removed from the pattern list.
- The command is processed using the embedding class's
MasterLauncher.processCommand(stella.CommandEvent) method. This method returns after the
command has been entirely executed. Any errors occuring during
this process must be cast by the MasterLauncher.processCommand(stella.CommandEvent) method.
- After the
MasterLauncher.processCommand(stella.CommandEvent) method returned, the
pattern list is checked for a match in an appropriate done
event. If a match is found a correct done event is forwarded to
the reply subscriber and the match is removed from the pattern list.
- The helper thread dies.
- Specified by:
run in interface Runnable- Overrides:
run in class Thread
checkForward
private void checkForward(String type)
- Checks the embedding's reply pattern list for a match to a reply
event constructed from the type handed over and the command event
registered. If a match is found the reply event created with the
ReplyEvent.createMatch(java.lang.Object, java.lang.String, long, stella.CommandEvent) method is returned. Note that the
returned reply event is neither a true acknowledge event
nor a true done event and can therfore not be casted or
instance tested to one of these reply subclasses.