{
Map<String, Class<? extends SaslClientFactory>> map = new HashMap<String, Class<? extends SaslClientFactory>>();
map.put("CRAM-MD5-HASHED", CRAMMD5HashedSaslClientFactory.class);
Security.addProvider(new JCAProvider(map));
CallbackHandler handler = new UsernameHashedPasswordCallbackHandler(
userName, password);
env.put("jmx.remote.profiles", Constants.SASL_CRAMMD5);
env.put("jmx.remote.sasl.callback.handler", handler);
}
else if (connectionType.equalsIgnoreCase("JMXMP_PLAIN"))