catch(Throwable t) { log.error("Cannot cancel delivery: " + d, t); } i.remove(); }
}
   void setStarted(boolean start)   {           if (start)      {         if (log.isTraceEnabled()) log.trace("attempting to add receiver");         boolean added = destination.add(this);         if (log.isTraceEnabled()) log.trace("added receiver: " + this.id + ", success=" + added);      }      else      {         if (log.isTraceEnabled()) log.trace("attempting to remove receiver from destination: " + destination);         boolean removed = destination.remove(this);         if (log.isTraceEnabled()) log.trace("receiver " + (removed ? "" : "NOT ")  + "removed");         for(Iterator i = deliveries.keySet().iterator(); i.hasNext(); )         {            Object messageID = i.next();            Delivery d = (Delivery)deliveries.get(messageID);            try            {               d.cancel();            }            catch(Throwable t)            {               log.error("Cannot cancel delivery: " + d, t);            }            i.remove();         }      }   }