activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r801075 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java
Date Wed, 05 Aug 2009 06:35:56 GMT
Author: rajdavies
Date: Wed Aug  5 06:35:56 2009
New Revision: 801075

URL: http://svn.apache.org/viewvc?rev=801075&view=rev
Log:
Fix for https://issues.apache.org/activemq/browse/AMQ-2328

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java?rev=801075&r1=801074&r2=801075&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java
Wed Aug  5 06:35:56 2009
@@ -63,6 +63,7 @@
     private boolean locallyCreateMBeanServer;
     private boolean createConnector = true;
     private boolean findTigerMbeanServer = true;
+    private String connectorHost = "localhost";
     private int connectorPort = 1099;
     private int rmiServerPort;
     private String connectorPath = "/jmxrmi";
@@ -426,9 +427,9 @@
         if (rmiServerPort != 0) {
             // This is handy to use if you have a firewall and need to
             // 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);
         connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, null, mbeanServer);
     }
@@ -464,4 +465,20 @@
     public void setCreateConnector(boolean 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;
+    }
 }



Mime
View raw message