env.put(JMXConnectorServer.AUTHENTICATOR, authenticator);
} else {
log.warn("Starting unauthenticating JMXConnector for " + jmxServiceURL);
}
server = JMXConnectorServerFactory.newJMXConnectorServer(jmxServiceURL, env, mbeanServer);
NotificationFilterSupport filter = new NotificationFilterSupport();
filter.enableType(JMXConnectionNotification.OPENED);
filter.enableType(JMXConnectionNotification.CLOSED);
filter.enableType(JMXConnectionNotification.FAILED);
server.addNotificationListener(authenticator, filter, null);
server.start();
log.debug("Started JMXConnector " + server.getAddress());
}