コード例 #1
0
 public void run() {
   try {
     TextCommandType type = command.getType();
     textCommandProcessors[type.getValue()].handle(command);
   } catch (Throwable e) {
     logger.log(Level.WARNING, e.getMessage(), e);
   }
 }
コード例 #2
0
 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;
     }
   }
 }