public void run() {
   try {
     TextCommandType type = command.getType();
     textCommandProcessors[type.getValue()].handle(command);
   } catch (Throwable e) {
     logger.log(Level.WARNING, e.getMessage(), e);
   }
 }
 public void run() {
   while (running) {
     try {
       TextCommand textCommand = blockingQueue.take();
       if (TextCommandConstants.TextCommandType.STOP == textCommand.getType()) {
         synchronized (stopObject) {
           stopObject.notify();
         }
       } else {
         SocketTextWriter socketTextWriter = textCommand.getSocketTextWriter();
         socketTextWriter.enqueue(textCommand);
       }
     } catch (InterruptedException e) {
       return;
     } catch (OutOfMemoryError e) {
       OutOfMemoryErrorDispatcher.onOutOfMemory(e);
       throw e;
     }
   }
 }
 public void sendResponse(TextCommand textCommand) {
   if (!textCommand.shouldReply() || textCommand.getRequestId() == -1) {
     throw new RuntimeException("Shouldn't reply " + textCommand);
   }
   responseThreadRunnable.sendResponse(textCommand);
 }