d.getReference().acquireReference();
   public void deliver(Delivery d) throws Throwable   {      if (d.getReference().isReliable() && !acceptReliableMessages)      {         throw new IllegalStateException("Delivery " + d + " of a reliable reference " +                                         " cannot be added to non-recoverable state");      }      // Note! Adding of deliveries to the state is NEVER done in a transactional context.      // The only things that are done in a transactional context are sending of messages      // and removing deliveries (acking).            deliveries.add(d);            d.getReference().acquireReference();            if (log.isTraceEnabled()) { log.trace(this + " added " + d + " to memory"); }   }