public synchronized void stopAgent() {
    if (!running) {
      return;
    }

    if (logger.isDebugEnabled()) {
      logger.debug("Stopping jmx manager agent");
    }
    try {
      jmxConnectorServer.stop();
      UnicastRemoteObject.unexportObject(registry, true);
    } catch (Exception e) {
      throw new ManagementException(e);
    }

    running = false;
  }
This system property is set to true when the embedded HTTP server is started so that the
embedded pulse webapp can use a local MBeanServer instead of a remote JMX connection.
geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java