private void registerFileUploaderMBean() {
    try {
      ObjectName mbeanON = new ObjectName(ManagementConstants.OBJECTNAME__FILEUPLOADER_MBEAN);
      MBeanServer platformMBeanServer = ManagementFactory.getPlatformMBeanServer();

      Set<ObjectName> names = platformMBeanServer.queryNames(mbeanON, null);
      if (names.isEmpty()) {
        platformMBeanServer.registerMBean(new FileUploader(getRemoteStreamExporter()), mbeanON);
        logger.info("Registered FileUploaderMBean on " + mbeanON);
      }
    } catch (InstanceAlreadyExistsException | MBeanRegistrationException
        | NotCompliantMBeanException | MalformedObjectNameException e) {
      throw new GemFireConfigException("Error while configuring FileUploader MBean", 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