if (log.isTraceEnabled()) { log.trace(this + " cancels deliveries"); }
if (trace) { log.trace(this + " cancels deliveries"); }
   void cancelAllDeliveries() throws JMSException   {      if (log.isTraceEnabled()) { log.trace(this + " cancels deliveries"); }                  //Need to cancel starting at the end of the list and working to the front      //in order that the messages end up back in the correct order in the channel            List toCancel = new ArrayList();            Iterator iter = deliveries.values().iterator();      while (iter.hasNext())      {         SingleReceiverDelivery d = (SingleReceiverDelivery)iter.next();         toCancel.add(d);      }            for (int i = toCancel.size() - 1; i >= 0; i--)      {            SingleReceiverDelivery d = (SingleReceiverDelivery)toCancel.get(i);         try         {            d.cancel();                  if (log.isTraceEnabled()) { log.trace(d +  " canceled"); }         }         catch(Throwable t)         {            log.error("Failed to cancel delivery: " + d, t);         }           }                 deliveries.clear();      promptDelivery();         }