private void registerAccessControlMBean() {
    try {
      AccessControlMBean acc = new AccessControlMBean(securityService);
      ObjectName accessControlMBeanON = new ObjectName(ResourceConstants.OBJECT_NAME_ACCESSCONTROL);
      MBeanServer platformMBeanServer = ManagementFactory.getPlatformMBeanServer();

      Set<ObjectName> names = platformMBeanServer.queryNames(accessControlMBeanON, null);
      if (names.isEmpty()) {
        try {
          platformMBeanServer.registerMBean(acc, accessControlMBeanON);
          logger.info("Registered AccessControlMBean on " + accessControlMBeanON);
        } catch (InstanceAlreadyExistsException | MBeanRegistrationException
            | NotCompliantMBeanException e) {
          throw new GemFireConfigException(
              "Error while configuring access control for jmx resource", e);
        }
      }
    } catch (MalformedObjectNameException e) {
      throw new GemFireConfigException("Error while configuring access control for jmx resource",
          e);
    }
  }
Gets the hostname that should be set on the RMI server for based on the given values.

@param hostnameForClients the hostname clients will expect to access.
@param hostnameForServer the hostname that this server is bound to.
@param sslEnabled is SSL enabled.
@return {@code hostnameForClients} if not blank, otherwise {@code hostnameForServer} if not
        blank and {@code sslEnabled}, otherwise {@code null}.
geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java