String msg = "Failed to initiate redelivery"; log.error(msg, t); throw new JMSException(msg);
log.error("Failed to rollback", t2); throw new IllegalStateException("Failed to rollback"); } } finally { if (txOld != null) { try { mgr.resume(txOld); } catch (Exception e) { log.error("Failed to resume tx", e); throw new IllegalStateException("Failed to resume tx"); }
   void redeliver() throws JMSException   {      // TODO I need to do this atomically, otherwise only some of the messages may be redelivered      // TODO and some old deliveries may be lost      if (log.isTraceEnabled()) { log.trace("redeliver"); }                                    List old = new ArrayList();      synchronized(deliveries)      {         for(Iterator i = deliveries.keySet().iterator(); i.hasNext();)         {            old.add(deliveries.get(i.next()));            i.remove();         }      }            if (log.isTraceEnabled()) { log.trace("There are " + old.size() + " deliveries to redeliver"); }      for(Iterator i = old.iterator(); i.hasNext();)      {         try         {            Delivery d = (Delivery)i.next();            d.redeliver(this);         }         catch(Throwable t)         {            String msg = "Failed to initiate redelivery";            log.error(msg, t);            throw new JMSException(msg);         }      }         }