[jboss-cvs] JBossAS SVN: r92247 - branches/JBPAPP_5_0/jbossas/jmx-remoting/src/main/org/jboss/mx/remoting/service.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Aug 11 22:08:32 EDT 2009
Author: david.lloyd at jboss.com
Date: 2009-08-11 22:08:31 -0400 (Tue, 11 Aug 2009)
New Revision: 92247
Modified:
branches/JBPAPP_5_0/jbossas/jmx-remoting/src/main/org/jboss/mx/remoting/service/JMXConnectorServerService.java
Log:
[JBPAPP-2342] Fix the JMX crap to bind to the right address
Modified: branches/JBPAPP_5_0/jbossas/jmx-remoting/src/main/org/jboss/mx/remoting/service/JMXConnectorServerService.java
===================================================================
--- branches/JBPAPP_5_0/jbossas/jmx-remoting/src/main/org/jboss/mx/remoting/service/JMXConnectorServerService.java 2009-08-11 19:31:30 UTC (rev 92246)
+++ branches/JBPAPP_5_0/jbossas/jmx-remoting/src/main/org/jboss/mx/remoting/service/JMXConnectorServerService.java 2009-08-12 02:08:31 UTC (rev 92247)
@@ -27,11 +27,16 @@
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.RemoteException;
+import java.util.Map;
+import java.util.HashMap;
+
import javax.management.MBeanServer;
import javax.management.ObjectName;
import javax.management.remote.JMXConnectorServer;
import javax.management.remote.JMXConnectorServerFactory;
import javax.management.remote.JMXServiceURL;
+import javax.management.remote.rmi.RMIConnectorServer;
+
import org.jboss.logging.Logger;
import org.jboss.net.sockets.DefaultSocketFactory;
/**
@@ -127,7 +132,11 @@
JMXServiceURL url = new JMXServiceURL(serviceURL);
// create new connector server and start it
- connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, null, mbeanServer);
+ final Map<String, Object> environment = new HashMap<String, Object>();
+ final DefaultSocketFactory clientSocketFactory = new DefaultSocketFactory();
+ clientSocketFactory.setBindAddress(bindAddress.getHostAddress());
+ environment.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, clientSocketFactory);
+ connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, environment, mbeanServer);
connectorServer.start();
log.info("JMX Connector server: " + serviceURL);
@@ -146,9 +155,9 @@
// do nothing, putting code in stop
}
- public ObjectName preRegister(MBeanServer mBeanServer, ObjectName objectName) throws Exception
+ public ObjectName preRegister(MBeanServer mbeanServer, ObjectName objectName) throws Exception
{
- this.mbeanServer = mBeanServer;
+ this.mbeanServer = mbeanServer;
return objectName;
}
More information about the jboss-cvs-commits
mailing list