Browse files

RMI host is only configurable on JVM start...

  • Loading branch information...
1 parent cd5e647 commit 963f24eb48b2a364b496882f22201d40b7c16c3a @daggerrz committed Apr 15, 2011
View
10 src/java/voldemort/server/VoldemortConfig.java
@@ -115,7 +115,6 @@
private RequestFormatType requestFormatType;
private int jmxRmiRegistryPort;
- private String jmxRmiServerHost;
private int jmxRmiServerPort;
private boolean enableSlop;
@@ -268,7 +267,6 @@ public VoldemortConfig(Props props) {
this.clientMaxQueuedRequests = props.getInt("client.max.queued.requests", 1000);
this.enableJmxRemote = props.getBoolean("jmx.remote.enable", false);
- this.jmxRmiServerHost = props.getString("jmx.remote.rmi.server.host", "localhost");
this.jmxRmiServerPort = props.getInt("jmx.remote.rmi.server.port", 10001);
this.jmxRmiRegistryPort = props.getInt("jmx.remote.rmi.registry.port", 10002);
@@ -1044,14 +1042,6 @@ public void setJmxRmiRegistryPort(int jmxRmiRegistryPort) {
this.jmxRmiRegistryPort = jmxRmiRegistryPort;
}
- public String getJmxRmiServerHost() {
- return jmxRmiServerHost;
- }
-
- public void setJmxRmiServerHost(String jmxRmiServerHost) {
- this.jmxRmiServerHost = jmxRmiServerHost;
- }
-
public int getJmxRmiServerPort() {
return jmxRmiServerPort;
}
View
1 src/java/voldemort/server/VoldemortServer.java
@@ -202,7 +202,6 @@ public AsyncOperationService getAsyncRunner() {
if(voldemortConfig.isJmxRemoteEnabled())
services.add(new JmxRemoteService(
voldemortConfig.getJmxRmiRegistryPort(),
- voldemortConfig.getJmxRmiServerHost(),
voldemortConfig.getJmxRmiServerPort())
);
View
16 src/java/voldemort/server/jmx/JmxRemoteService.java
@@ -51,7 +51,6 @@
private final Logger log = Logger.getLogger(JmxService.class);
private int rmiRegistryPort;
- private String rmiServerHost;
private int rmiServerPort;
protected boolean rmiSSL = true;
@@ -63,12 +62,11 @@
protected String accessFile = null;
protected boolean useLocalPorts = false;
- protected JMXConnectorServer csPlatform = null;
+ protected JMXConnectorServer jmxConnector = null;
- public JmxRemoteService(int rmiRegistryPort, String rmiServerHost, int rmiServerPort) {
+ public JmxRemoteService(int rmiRegistryPort, int rmiServerPort) {
super(ServiceType.JMX_REMOTE);
this.rmiRegistryPort = rmiRegistryPort;
- this.rmiServerHost = rmiServerHost;
this.rmiServerPort = rmiServerPort;
}
@@ -147,9 +145,6 @@ protected void startInner() {
ssf);
}
- // Explicitly specify host name to receive RMI callbacks.
- env.put("java.rmi.server.useLocalHostname", "false");
- env.put("java.rmi.server.hostname", rmiServerHost);
// Configure authentication
if (authenticate) {
@@ -158,7 +153,7 @@ protected void startInner() {
}
// Create the Platform server
- csPlatform = createServer(rmiRegistryPort,
+ jmxConnector = createServer(rmiRegistryPort,
rmiServerPort, env,
ManagementFactory.getPlatformMBeanServer());
@@ -167,7 +162,7 @@ protected void startInner() {
@Override
protected void stopInner() {
// When the server starts, configure JMX/RMI
- destroyServer("Platform", csPlatform);
+ destroyServer(jmxConnector);
}
@@ -211,8 +206,7 @@ private JMXConnectorServer createServer(int theRmiRegistryPort, int theRmiServer
return cs;
}
- private void destroyServer(String serverName,
- JMXConnectorServer theConnectorServer) {
+ private void destroyServer(JMXConnectorServer theConnectorServer) {
if (theConnectorServer != null) {
try {
theConnectorServer.stop();

0 comments on commit 963f24e

Please sign in to comment.