AMQ-5247: Make jmxUseLocal global settable

This commit is contained in:
Benjamin Graf 2016-11-20 17:27:31 +01:00 committed by Claus Ibsen
parent 00129837de
commit 7dc70e03ea
1 changed files with 3 additions and 2 deletions

View File

@ -38,11 +38,11 @@ public abstract class AbstractJmxCommand extends AbstractCommand {
public static String DEFAULT_JMX_URL;
private static String jmxUser;
private static String jmxPassword;
private static boolean jmxUseLocal;
private static final String CONNECTOR_ADDRESS =
"com.sun.management.jmxremote.localConnectorAddress";
private JMXServiceURL jmxServiceUrl;
private boolean jmxUseLocal;
private JMXConnector jmxConnector;
private MBeanServerConnection jmxConnection;
@ -50,6 +50,7 @@ public abstract class AbstractJmxCommand extends AbstractCommand {
DEFAULT_JMX_URL = System.getProperty("activemq.jmx.url", "service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi");
jmxUser = System.getProperty("activemq.jmx.user");
jmxPassword = System.getProperty("activemq.jmx.password");
jmxUseLocal = Boolean.parseBoolean(System.getProperty("activemq.jmx.useLocal", "false"));
}
/**
@ -255,7 +256,7 @@ public abstract class AbstractJmxCommand extends AbstractCommand {
* @param jmxUseLocal - <code>true</code> if the mbean server from this JVM should be used, <code>false<code> if the jmx url should be used
*/
public void setJmxUseLocal(boolean jmxUseLocal) {
this.jmxUseLocal = jmxUseLocal;
AbstractJmxCommand.jmxUseLocal = jmxUseLocal;
}
/**