Beispiel #1
0
  private void processNext() {

    AbstractDeliveringElement element = this.messagesQueue.take();
    List<MessagesPane> localPanes = null;
    AtomicReference<LinkedList<AbstractDeliveringElement>> releasedList =
        new AtomicReference<LinkedList<AbstractDeliveringElement>>();
    synchronized (this.panes) {
      localPanes = getPanes(element, releasedList);
    }
    if (releasedList.get() == null) {
      if (logger.isDebugEnabled()) {
        logger.debug(
            "Suggesting to pocessing element " + DeliverersManager.FACTORY.getLogInfo(element));
      }
      DeliverProcessor.process(element, localPanes);
    } else {
      if (logger.isDebugEnabled()) {
        logger.debug(
            "Processing with released list element "
                + DeliverersManager.FACTORY.getLogInfo(element));
      }
      DeliverProcessor.process(element, localPanes);
      for (AbstractDeliveringElement el : releasedList.get()) {
        if (logger.isDebugEnabled()) {
          logger.debug(
              "Processing as element from release list element "
                  + DeliverersManager.FACTORY.getLogInfo(el));
        }
        DeliverProcessor.process(el, localPanes);
      }
    }
  }
Beispiel #2
0
 private boolean processIsBlocked(AbstractDeliveringElement element, MessagesPane pane) {
   for (BlockedPane blockedPane : this.blockedPanes) {
     if (blockedPane.pane == pane) {
       if (logger.isDebugEnabled()) {
         logger.debug("Adding to block list " + DeliverersManager.FACTORY.getLogInfo(element));
       }
       blockedPane.put(element);
       return true;
     }
   }
   return false;
 }