Package org.objectweb.joram.mom.notifications

Examples of org.objectweb.joram.mom.notifications.ClientMessages


    RequestGroupNot not = (RequestGroupNot) nots.get(to);
    if (not == null) {
      not = new RequestGroupNot();
      nots.put(to, not);
    }
    ClientMessages cm = new ClientMessages(key, req.getRequestId(), req
        .getMessages());
    if (to.getTo() == proxyAgent.getId().getTo()) {
      cm.setPersistent(false);
    }
    if (req.getAsyncSend()) {
      cm.setAsyncSend(true);
    }
    not.addClientMessages(cm);
  }
View Full Code Here


        logger.log(BasicLevel.DEBUG, "Message already received, drop the message " + not);
      }
      return;
    }
    lastMessageId = not.getId();
    ClientMessages clientMessages = acquisitionModule.acquisitionNot(not, msgCount);
    if (clientMessages != null) {
      msgCount += clientMessages.getMessageCount();
      addClientMessages(clientMessages);
    }
  }
View Full Code Here

      default:
        break;
      }

      if (deadMessages == null) {
        deadMessages = new ClientMessages();
      }
      mess.expiration = 0;
      deadMessages.addMessage(mess);
    }
    if (logger.isLoggable(BasicLevel.DEBUG))
View Full Code Here

   * <p>
   * This method stores the messages and launches a delivery sequence.
   */
  protected void doClientMessages(AgentId from, ClientMessages not) {
    receiving = true;
    ClientMessages cm = null;
   
    // interceptors
    if (interceptorsAvailable()) {
      // new client message
      cm = new ClientMessages(not.getClientContext(), not.getRequestId());
      cm.setAsyncSend(not.getAsyncSend());
      cm.setDMQId(not.getDMQId());
     
      for (Iterator msgs = not.getMessages().iterator(); msgs.hasNext();) {
        org.objectweb.joram.shared.messages.Message message = (org.objectweb.joram.shared.messages.Message) msgs.next();
        // set the destination name
        message.setProperty("JoramDestinationName", getName());
        // interceptors process
        org.objectweb.joram.shared.messages.Message m = processInterceptors(message);
        if (m == null) {
          // send message to the DMQ
          DMQManager dmqManager = new DMQManager(dmqId, getId());
          nbMsgsSentToDMQSinceCreation++;
          dmqManager.addDeadMessage(message, MessageErrorConstants.INTERCEPTORS);
          dmqManager.sendToDMQ();
          new Message(message).releaseFullMessage();
        } else {
          // add message to the client message
          cm.addMessage(m);
        }
      }
      // test client message size.
      if (cm.getMessageCount() == 0) {
        receiving = false;
        return;
      }
    } else {
      cm = not;
    }
   
    // pre process the client message
    ClientMessages clientMsgs = preProcess(from, cm);

    if (clientMsgs != null) {
      Message msg;
      // Storing each received message:
      for (Iterator msgs = clientMsgs.getMessages().iterator(); msgs.hasNext();) {

        msg = new Message((org.objectweb.joram.shared.messages.Message) msgs.next());

        msg.order = arrivalsCounter++;
        storeMessage(msg);
View Full Code Here

   */
  protected ClientMessages getClientMessages(int nb, String selector, boolean remove) {  
    if (logger.isLoggable(BasicLevel.DEBUG))
      logger.log(BasicLevel.DEBUG, "Queue.getClientMessages(" + nb + ',' + selector + ',' + remove + ')');

    ClientMessages cm = null ;
    List lsMessages = getMessages(nb, selector, remove);
    if (lsMessages.size() > 0) {
      cm = new ClientMessages();
    }
    Message message = null;
    Iterator itMessages = lsMessages.iterator();
    while (itMessages.hasNext()) {
      message = (Message) itMessages.next();
      cm.addMessage(message.getFullMessage());
    }
    return cm;
  }
View Full Code Here

        logger.log(BasicLevel.DEBUG, "Message already received, drop the message " + not);
      }
      return;
    }
    lastMessageId = not.getId();
    ClientMessages clientMessages = acquisitionModule.acquisitionNot(not, msgCount);
    if (clientMessages != null) {
      msgCount += clientMessages.getMessageCount();
      forwardMessages(clientMessages);
      processMessages(clientMessages);
      postProcess(clientMessages);
    }
  }
View Full Code Here

  /**
   * Reacts to <code>BridgeDeliveryNot</code> notifications holding a message
   * received from the foreign JMS server.
   */
  private void bridgeDeliveryNot(AgentId from, JMSBridgeDeliveryNot not) {
    ClientMessages clientMessages = new ClientMessages();
    clientMessages.addMessage(not.getMessage());
    super.doClientMessages(getId(), clientMessages);
  }
View Full Code Here

   *
   * @param from  AgentId
   * @param not   BridgeDeliveryNot
   */
  private void bridgeDelivery(AgentId from, JMSBridgeDeliveryNot not) {
    ClientMessages clientMessages = new ClientMessages();
    clientMessages.addMessage(not.getMessage());
    // it come from bridge, so set destId for from
    //(do not preProcess this ClientMessage).
    super.doClientMessages(getId(), clientMessages);
  }
View Full Code Here

  protected void doClientMessages(AgentId from, ClientMessages not) {
    doClientMessages(from, not, false);
  }

  private void doClientMessages(AgentId from, ClientMessages not, boolean fromCluster) {
    ClientMessages clientMsgs = preProcess(from, not);
    if (clientMsgs != null) {
      // Forwarding the messages to the father or the cluster fellows, if any:
      forwardMessages(clientMsgs, fromCluster);

      // Processing the messages:
View Full Code Here

 
  public ClientMessages acquisitionNot(AcquisitionNot not, long msgCount) {
    if (logger.isLoggable(BasicLevel.DEBUG)) {
      logger.log(BasicLevel.DEBUG, "AcquisitionModule.acquisitionNot(" + not + ")");
    }
    ClientMessages acquiredCM = not.getAcquiredMessages();
    List messages = acquiredCM.getMessages();
    if (messages.size() == 0) {
      return null;
    }
    setMessagesInfo(messages, msgCount);
    return acquiredCM;
View Full Code Here

TOP

Related Classes of org.objectweb.joram.mom.notifications.ClientMessages

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.