git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@801075 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2009-08-05 06:35:56 +00:00
parent 0479a4eddb
commit dab69242d5
1 changed files with 19 additions and 2 deletions

View File

@ -63,6 +63,7 @@ public class ManagementContext implements Service {
private boolean locallyCreateMBeanServer; private boolean locallyCreateMBeanServer;
private boolean createConnector = true; private boolean createConnector = true;
private boolean findTigerMbeanServer = true; private boolean findTigerMbeanServer = true;
private String connectorHost = "localhost";
private int connectorPort = 1099; private int connectorPort = 1099;
private int rmiServerPort; private int rmiServerPort;
private String connectorPath = "/jmxrmi"; private String connectorPath = "/jmxrmi";
@ -426,9 +427,9 @@ public class ManagementContext implements Service {
if (rmiServerPort != 0) { if (rmiServerPort != 0) {
// This is handy to use if you have a firewall and need to // This is handy to use if you have a firewall and need to
// force JMX to use fixed ports. // force JMX to use fixed ports.
rmiServer = "localhost:" + rmiServerPort; rmiServer = ""+getConnectorHost()+":" + rmiServerPort;
} }
String serviceURL = "service:jmx:rmi://" + rmiServer + "/jndi/rmi://localhost:" + connectorPort + connectorPath; String serviceURL = "service:jmx:rmi://" + rmiServer + "/jndi/rmi://" +getConnectorHost()+":" + connectorPort + connectorPath;
JMXServiceURL url = new JMXServiceURL(serviceURL); JMXServiceURL url = new JMXServiceURL(serviceURL);
connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, null, mbeanServer); connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, null, mbeanServer);
} }
@ -464,4 +465,20 @@ public class ManagementContext implements Service {
public void setCreateConnector(boolean createConnector) { public void setCreateConnector(boolean createConnector) {
this.createConnector = createConnector; this.createConnector = createConnector;
} }
/**
* Get the connectorHost
* @return the connectorHost
*/
public String getConnectorHost() {
return this.connectorHost;
}
/**
* Set the connectorHost
* @param connectorHost the connectorHost to set
*/
public void setConnectorHost(String connectorHost) {
this.connectorHost = connectorHost;
}
} }