scheduled = false;
}
// Sending client messages:
try {
CommitRequest commitReq = new CommitRequest();
Enumeration producerMessages = sendings.elements();
while (producerMessages.hasMoreElements()) {
ProducerMessages pM = (ProducerMessages) producerMessages.nextElement();
commitReq.addProducerMessages(pM);
}
sendings.clear();
// Acknowledging the received messages:
Enumeration targets = deliveries.keys();
while (targets.hasMoreElements()) {
String target = (String) targets.nextElement();
MessageAcks acks = (MessageAcks) deliveries.get(target);
commitReq.addAckRequest(new SessAckRequest(target, acks.getIds(), acks.getQueueMode()));
}
deliveries.clear();
if (asyncSend) {
// Asynchronous sending
commitReq.setAsyncSend(true);
mtpx.sendRequest(commitReq);
} else {
requestor.request(commitReq);
}