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))
logger.log(BasicLevel.DEBUG, "--- " + this
+ " ClusterQueue.lBMessageHope LBMessageHope : nbMsgSend = " + cm.getMessages().size());
}
}