code: public void closeAllConsumersForDelete(DestinationHandler destinationBeingDeleted)
      {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.entry(tc, "closeAllConsumersForDelete", destinationBeingDeleted);
  
          Iterator<DispatchableKey> itr = null;
          Iterator<DispatchableKey> clonedItr = null;
  
          // The consumerPoints list is cloned for the notifyException
          // call.
          synchronized (consumerPoints)
          {
              //since the close of the underlying session causes the consumer point to
              //be removed from the list we have to take a clone of the list
              clonedItr = ((LinkedList<DispatchableKey>) consumerPoints.clone()).iterator();
              itr = ((LinkedList<DispatchableKey>) consumerPoints.clone()).iterator();
          }
  
          // Defect 360452
          // Iterate twice to avoid deadlock. First iteration to mark
          // as not ready. This ensure no messages on the destination
          // will arrive at the consumers.
          synchronized (_baseDestHandler.getReadyConsumerPointLock())
          {
              while (itr.hasNext())
              {
                  DispatchableKey consumerKey = itr.next();
  
                  // If we're making the consumer notReady then we must also remove
                  // them from the list of ready consumers that we hold
                  if (consumerKey.isKeyReady())
                      removeReadyConsumer(consumerKey.getParent(), consumerKey.isSpecific());
  
                  consumerKey.markNotReady();
              }
          }
  
          // Second iteration to close sessions outside of readyConsumerPointLock
          // to avoid deadlock with receive.
          while (clonedItr.hasNext())
          {
              DispatchableKey consumerKey = clonedItr.next();
              consumerKey.getConsumerPoint().implicitClose(destinationBeingDeleted.getUuid(), null, _messageProcessor.getMessagingEngineUuid());
          }
  
          // Close any browsers
          closeBrowsersDestinationDeleted(destinationBeingDeleted);
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.exit(tc, "closeAllConsumersForDelete");
      }
docs: Method closeAllConsumersForDelete.
  <p>Called when the local destination is being deleted, to close all attached
  consumers.</p>