if (acknowledgeMode == Session.CLIENT_ACKNOWLEDGE)
{
for(Iterator i = getClientAckList().iterator(); i.hasNext(); )
{
DeliveryInfo info = (DeliveryInfo)i.next();
if (!info.getMessageProxy().getMessage().isReliable())
{
i.remove();
log.trace("removed non persistent delivery " + info);
}
}
ackInfos = getClientAckList();
}
else
{
DeliveryInfo autoAck = getAutoAckInfo();
if (autoAck != null)
{
if (!autoAck.getMessageProxy().getMessage().isReliable())
{
// unreliable, discard
setAutoAckInfo(null);
}
else
{
// reliable
ackInfos = new ArrayList();
ackInfos.add(autoAck);
}
}
}
log.trace(this + " retrieved " + ackInfos.size() + " deliveries");
}
else
{
// Transacted session - we need to get the acks from the resource manager. BTW we have
// kept the old resource manager.
ackInfos = rm.getDeliveriesForSession(getSessionID());
}
List recoveryInfos = new ArrayList();
if (!ackInfos.isEmpty())
{
for (Iterator i = ackInfos.iterator(); i.hasNext(); )
{
DeliveryInfo del = (DeliveryInfo)i.next();
DeliveryRecovery recInfo =
new DeliveryRecovery(del.getMessageProxy().getDeliveryId(),
del.getMessageProxy().getMessage().getMessageID(),
del.getQueueName());
recoveryInfos.add(recInfo);
}
}