if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, "Session.receive(" + requestTimeToLive + ',' + waitTimeOut + ','
+ targetName + ',' + selector + ',' + queueMode + ')');
preReceive(mc);
try {
ConsumerMessages reply = null;
ConsumerReceiveRequest request = new ConsumerReceiveRequest(targetName, selector, requestTimeToLive, queueMode);
if (implicitAck)
request.setReceiveAck(true);
reply = (ConsumerMessages) receiveRequestor.request(request, waitTimeOut);
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, " -> reply = " + reply);
synchronized (this) {
// The session may have been
// closed in between.
if (status == Status.CLOSE) {
if (reply != null) {
mtpx.deny(reply);
}
return null;
}
if (reply != null) {
Vector msgs = reply.getMessages();
if (msgs != null && !msgs.isEmpty()) {
Message msg = Message.wrapMomMessage(this, (org.objectweb.joram.shared.messages.Message) msgs.get(0));
String msgId = msg.getJMSMessageID();
// Auto ack: acknowledging the message: