Ejemplo n.º 1
0
 Deliverer(String sphereId) {
   if (logger.isDebugEnabled()) {
     logger.debug("Deliverer started for: " + sphereId);
   }
   this.sphereId = sphereId;
   this.panes = new ArrayList<MessagesPane>();
   this.messagesQueue = new MessagesLine();
   this.blockedPanes = new ArrayList<BlockedPane>();
   this.deliver =
       new Thread() {
         @Override
         public void run() {
           while (Deliverer.this.alive) {
             if (Deliverer.this.blocked) {
               try {
                 sleep(100);
               } catch (InterruptedException ex) {
                 logger.error("Interrupted");
               }
             } else {
               processNext();
             }
           }
         }
       };
   ThreadUtils.startDemon(this.deliver, "Messages deliverer for sphereId: " + sphereId);
 }
Ejemplo n.º 2
0
 public void start() {
   ThreadUtils.start(
       new Runnable() {
         public void run() {
           safeUpdate();
         }
       },
       getClass());
 }