// Prefix for getting particular JMX properties
String prefix = JmxConfigurationConstants.PROP_SYNAPSE_PREFIX_JMX;
JmxInformation jmxInformation = new JmxInformation();
SecretInformation secretInformation = SecretInformationFactory.createSecretInformation(
properties, prefix, null);
secretInformation.setToken(JmxConfigurationConstants.JMX_PROTECTED_TOKEN);
jmxInformation.setSecretInformation(secretInformation);
int jndiPort = MiscellaneousUtil.getProperty(
properties, prefix + JmxConfigurationConstants.PROP_JNDI_PORT, -1, Integer.class);
jmxInformation.setJndiPort(jndiPort);
int rmiPort = MiscellaneousUtil.getProperty(
properties, prefix + JmxConfigurationConstants.PROP_RMI_PORT, 0, Integer.class);
jmxInformation.setRmiPort(rmiPort);
String jmxHostName = MiscellaneousUtil.getProperty(
properties, prefix + JmxConfigurationConstants.PROP_HOSTNAME, null);
if (jmxHostName == null || jmxHostName.trim().length() == 0) {
jmxHostName = defaultHostName;
}
jmxInformation.setHostName(jmxHostName);
// begin of special JMX security options
Properties managementProperties = readManagementProperties();
Boolean authenticate;
String value = getConfigProperty(
managementProperties, "com.sun.management.jmxremote.authenticate");
if (value != null) {
authenticate = Boolean.valueOf(value);
} else {
if (secretInformation.getUser() == null) {
authenticate = Boolean.FALSE;
} else {
authenticate = Boolean.TRUE;
}
}