private void pollAgentForShutdown() throws InterruptedException {
    final long endTime = (System.currentTimeMillis() + 20000);
    long clock = 0;

    while (clock < endTime && !isStatus(SHUTDOWN)) {
      pause(500);
      spinReadStatus();
      clock = System.currentTimeMillis();
    }
  }
Stops a running JMX Agent by setting the status to "shutdown pending".
geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentLauncher.java