stella.net
Class CommandReceiver.CommandHandler.OneCommandCycle

java.lang.Object
  extended by java.lang.Thread
      extended by stella.net.CommandReceiver.CommandHandler.OneCommandCycle
All Implemented Interfaces:
Runnable
Enclosing class:
CommandReceiver.CommandHandler

private class CommandReceiver.CommandHandler.OneCommandCycle
extends Thread

A class that deals with the completion of one command cycle. It uses its own thread because the CommandReceiver.processCommand(stella.CommandEvent, int) method is blocking.
Additionally, this is an inner class to the inner class CommandReceiver.CommandHandler, because we need access to the I/O streams of the socket allocated in the command handler.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
private  CommandEvent todo
          The command to execute.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
private CommandReceiver.CommandHandler.OneCommandCycle(CommandEvent cmd)
          Constructs a new single command cyle object.
 
Method Summary
 void run()
          The run command.
 
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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

todo

private CommandEvent todo
The command to execute.

Constructor Detail

CommandReceiver.CommandHandler.OneCommandCycle

private CommandReceiver.CommandHandler.OneCommandCycle(CommandEvent cmd)
Constructs a new single command cyle object. The thread associated with this object is not started automatically.

Method Detail

run

public void run()
The run command. It simply send back the acknowledge messages, proceeds on the execution of the command, check for errors occuring during execution and send a final done event.

Specified by:
run in interface Runnable
Overrides:
run in class Thread