public static Set send(final DistributionManager dm, long timeout) {
    boolean hadCache = hasCache(dm);
    ClusterDistributionManager dism =
        dm instanceof ClusterDistributionManager ? (ClusterDistributionManager) dm : null;
    InternalDistributedMember myId = dm.getDistributionManagerId();

    Set recipients = dm.getOtherNormalDistributionManagerIds();

    recipients.remove(myId);

    // now do shutdownall
    ShutdownAllRequest request = new ShutdownAllRequest();
    request.setRecipients(recipients);

    ShutDownAllReplyProcessor replyProcessor = new ShutDownAllReplyProcessor(dm, recipients);
    request.msgId = replyProcessor.getProcessorId();
    dm.putOutgoing(request);

    if (!InternalLocator.isDedicatedLocator()) {
      if (hadCache && dism != null) {
        AdminResponse response;
        try {
          request.setSender(myId);
          response = request.createResponse(dism);
        } catch (Exception ex) {
          if (logger.isDebugEnabled()) {
            logger.debug("caught exception while processing shutdownAll locally", ex);
          }
          response = AdminFailureResponse.create(myId, ex);
        }
        response.setSender(myId);
        replyProcessor.process(response);
      }
    }

    boolean interrupted = false;
    try {
      if (!replyProcessor.waitForReplies(timeout)) {
        return null;
      }
    } catch (ReplyException e) {
      if (!(e.getCause() instanceof CancelException)) {
        e.handleCause();
      }
    } catch (CancelException ignore) {
      // expected
    } catch (InterruptedException ignore) {
      interrupted = true;
    }

    // wait until all the recipients send response, shut down itself (if not a locator)
    if (hadCache) {
      // at this point,GemFireCacheImpl.getInstance() might return null,
      // because the cache is closed at GemFireCacheImpl.getInstance().shutDownAll()
      if (!InternalLocator.isDedicatedLocator()) {
        InternalDistributedSystem ids = dm.getSystem();
        if (ids.isConnected()) {
          ids.disconnect();
        }
      }
    }

    if (interrupted) {
      Thread.currentThread().interrupt();
    }

    try {
      Thread.sleep(3 * SLEEP_TIME_BEFORE_DISCONNECT_DS);
    } catch (InterruptedException ignore) {
    }
    return replyProcessor.getResults();
  }
Sends a shutdownAll request to all other members and performs local shutdownAll processing in
the waitingThreadPool.
geode-core/src/main/java/org/apache/geode/internal/admin/remote/ShutdownAllRequest.java