public void acknowledge(Message r, Transaction tx) throws Throwable
{
log.debug(this + " acknowledging " + r);
Object[] touple = null;
Delivery d = null;
for (Iterator i = messages.iterator(); i.hasNext(); )
{
Object[] o = (Object[])i.next();
Message m = (Message)o[0];
if (m == r)
{
log.trace("*** found it");
d = (Delivery)o[1];
touple = o;
break;
}
}
if (touple == null)
{
throw new IllegalStateException("The message " + r + " hasn't been received yet!");
}
if (d == null)
{
throw new IllegalStateException("The message " + r + " has already been acknowledged!");
}
d.acknowledge(tx);
log.trace(this + " acknowledged " + r);
// make sure I get rid of message if the transaction is rolled back
if (tx != null)