Examples of LBMessageGive


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

    if (dmqManager != null)
      dmqManager.sendToDMQ();
   
    if (loadingFactor.getRateOfFlow() < 1) {
      int possibleGive = getPendingMessageCount() - getWaitingRequestCount();
      LBMessageGive msgGive =
        new LBMessageGive(loadingFactor.validityPeriod, loadingFactor.getRateOfFlow());
     
      // get client messages, hope or possible give.
      ClientMessages cm = null;
      if (possibleGive > hope) {
        cm = getClientMessages(hope, null, true);
      } else {
        cm = getClientMessages(possibleGive, null, true);
      }

      msgGive.setClientMessages(cm);
      msgGive.setRateOfFlow(loadingFactor.evalRateOfFlow(getPendingMessageCount(), getWaitingRequestCount()));

      // send notification contains ClientMessages.
      forward(from, msgGive);
     
      if (logger.isLoggable(BasicLevel.DEBUG))
View Full Code Here

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

    }

    if (selected.size() == 0) return;

    int nbGivePerQueue = nbMsgGive / selected.size();
    LBMessageGive msgGive = new LBMessageGive(validityPeriod, rateOfFlow);

    if (nbGivePerQueue == 0 && nbMsgGive > 0) {
      // send all to the first element of clusterQueue.
      AgentId id = (AgentId) selected.get(0);
      if (logger.isLoggable(BasicLevel.DEBUG))
        logger.log(BasicLevel.DEBUG,
                   "LoadingFactor.processGive" +
                   " nbMsgGive = " + nbMsgGive +
                   ", id = " + id);
      msgGive.setClientMessages(clusterQueue.getClientMessages(nbMsgGive, null, true));
      clusterQueue.forward(id, msgGive);
    } else {
      // dispatch to cluster.
      if (logger.isLoggable(BasicLevel.DEBUG))
        logger.log(BasicLevel.DEBUG,
                   "LoadingFactor.processGive" +
                   " givePerQueue = " + nbGivePerQueue +
                   ", selected = " + selected);
      for (Iterator e = selected.iterator(); e.hasNext();) {
        AgentId id = (AgentId) e.next();
        msgGive.setClientMessages(clusterQueue.getClientMessages(nbGivePerQueue, null, true));
        clusterQueue.forward(id, msgGive);
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.