}
if (db instanceof Base64MD5PasswordFilePrincipalDatabase)
{
env.put("jmx.remote.profiles", "SASL/CRAM-MD5");
CRAMMD5HashedInitialiser initialiser = new CRAMMD5HashedInitialiser();
initialiser.initialise(db);
env.put("jmx.remote.sasl.callback.handler", initialiser.getCallbackHandler());
}
else if (db instanceof PlainPasswordFilePrincipalDatabase)
{
PlainInitialiser initialiser = new PlainInitialiser();
initialiser.initialise(db);
env.put("jmx.remote.sasl.callback.handler", initialiser.getCallbackHandler());
env.put("jmx.remote.profiles", "SASL/PLAIN");
}
//workaround NPE generated from env map classloader issue when using Eclipse 3.4 to launch
env.put("jmx.remote.profile.provider.class.loader", this.getClass().getClassLoader());