@Override
  public void stop() {
    try {
      logger.info("Stopping JMX agent");

      loggingSession.stopSession();

      // stop the GemFire Distributed System
      stopDistributedSystem();

      // stop all JMX Adaptors and Connectors...
      stopHttpAdaptor();
      stopRMIConnectorServer();
      memberInfoWithStatsMBean = null;
      stopSnmpAdaptor();

      // release the MBeanServer for cleanup...
      MBeanUtils.stop();
      mBeanServer = null;

      // remove the register shutdown hook which disconnects the Agent from the Distributed System
      // upon JVM shutdown
      removeShutdownHook();

      logger.info("Agent has stopped");
    } finally {
      loggingSession.shutdown();
    }

  }
Deregisters everything this Agent registered and releases the MBeanServer.
geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentImpl.java