Object[] args = mi.getArguments(); DeliveryInfo info = (DeliveryInfo)args[0];  state.getToAck().add(info);
   public Object handlePreDeliver(Invocation invocation) throws Throwable   {       MethodInvocation mi = (MethodInvocation)invocation;      SessionState state = getState(invocation);            int ackMode = state.getAcknowledgeMode();            if (ackMode == Session.CLIENT_ACKNOWLEDGE ||          ackMode == Session.AUTO_ACKNOWLEDGE ||          ackMode == Session.DUPS_OK_ACKNOWLEDGE ||          state.getCurrentTxId() == null)      {         // We collect acknowledgments (and not transact them) for CLIENT, AUTO and DUPS_OK, and         // also for XA sessions not enlisted in a global transaction.          // We store the ack in a list for later acknowledgement or recovery             Object[] args = mi.getArguments();         DeliveryInfo info = (DeliveryInfo)args[0];         state.getToAck().add(info);                  if (trace)         {             SessionDelegate del = (SessionDelegate)mi.getTargetObject();                        log.trace("ack mode is " + Util.acknowledgmentModeToString(ackMode)+ ", acknowledged on " + del);         }      }      return invocation.invokeNext();   }