@Override
  public void stop() throws AdminException {
    // Stop cache server before GemFire managers because the cache
    // server might host a cache proxy that is dependent on the
    // manager. See bug 32569.

    // Wait for each managed entity to stop (see bug 32569)
    long timeout = 30;

    CacheServer[] servers = getCacheServers();
    for (final CacheServer cacheServer : servers) {
      cacheServer.stop();
    }
    for (final CacheServer server : servers) {
      try {
        if (!server.waitToStop(timeout * 1000)) {
          throw new AdminException(
              String.format("%s did not stop after %s seconds.",
                  server, timeout));
        }

      } catch (InterruptedException ex) {
        Thread.currentThread().interrupt();
        throw new AdminException(
            String.format("Interrupted while waiting for %s to stop.",
                server),
            ex);
      }
    }

    DistributionLocator[] locs = getDistributionLocators();
    for (final DistributionLocator distributionLocator : locs) {
      distributionLocator.stop();
    }
    for (final DistributionLocator loc : locs) {
      try {
        if (!loc.waitToStop(timeout * 1000)) {
          throw new AdminException(
              String.format("%s did not stop after %s seconds.",
                  loc, timeout));
        }

      } catch (InterruptedException ex) {
        Thread.currentThread().interrupt();
        throw new AdminException(
            String.format("Interrupted while waiting for %s to stop.",
                loc),
            ex);
      }
    }
  }
Stops all GemFire managers that are members of this system.
geode-core/src/main/java/org/apache/geode/admin/internal/AdminDistributedSystemImpl.java