public void stopConnectorServer() throws IOException {
    synchronized (JMXListener.class) {
      if (JMX_CS != null) {
        JMX_CS.stop();
        LOG.info("ConnectorServer stopped!");
        JMX_CS = null;
      }
      // deregister the RMI registry
      if (rmiRegistry != null) {
        UnicastRemoteObject.unexportObject(rmiRegistry, true);
      }
    }
  }
workaround for HBASE-11146 master and regionserver are in 1 JVM in standalone mode only 1 JMX
instance is allowed, otherwise there is port conflict even if we only load regionserver
coprocessor on master
hbase-server/src/main/java/org/apache/hadoop/hbase/JMXListener.java