private void start() {

        setContainer(new MBeanContainer(ManagementFactory.getPlatformMBeanServer()));
        int jmxPort = JMXManager.getPort();
        String jmxUrl = "/jndi/rmi://localhost:" + jmxPort + "/jmxrmi";
        Map<String, Object> env = new HashMap<>();
        if (JMXManager.isSecure()) {
            env.put("jmx.remote.authenticator", (JMXAuthenticator) credentials -> {
                if (!(credentials instanceof String[])) {
                    if (credentials == null) {
                        throw new SecurityException("Credentials required");
                    }
                    throw new SecurityException("Credentials should be String[]");
                }
                final String[] aCredentials = (String[]) credentials;
                if (aCredentials.length < 2) {
                    throw new SecurityException("Credentials should have at least two elements");
                }
                String username = aCredentials[0];
                String password = aCredentials[1];

                try {
                    AuthFactory.authenticate(username, password);
                } catch (Exception ex) {
                    Log.error("Authentication failed for " + username);
                    throw new SecurityException();
                }

                if (AdminManager.getInstance().isUserAdmin(username, true)) {
                    return new Subject(true,
                                       Collections.singleton(new JMXPrincipal(username)),
                                       Collections.EMPTY_SET,
                                       Collections.EMPTY_SET);
                } else {
                    Log.error("Authorization failed for " + username);
                    throw new SecurityException();
                }
            });
        }
        
        try {
            jmxServer = new ConnectorServer(new JMXServiceURL("rmi", null, jmxPort, jmxUrl), 
                    env, "org.eclipse.jetty.jmx:name=rmiconnectorserver");
            jmxServer.start();
        } catch (Exception e) {
            Log.error("Failed to start JMX connector", e);
        }
    }
Returns true if JMX support is enabled. This option can be 
configured via the admin console or by setting the following 
system property:
<pre>
   xmpp.jmx.enabled=true (default: false)
</pre>

@return true if JMX support is enabled
xmppserver/src/main/java/org/jivesoftware/openfire/JMXManager.java