You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2016/10/21 09:04:22 UTC
svn commit: r1765964 -
/tomcat/tc6.0.x/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java
Author: markt
Date: Fri Oct 21 09:04:22 2016
New Revision: 1765964
URL: http://svn.apache.org/viewvc?rev=1765964&view=rev
Log:
Whitespace / formatting /minor style changes to better align with 7.0.x
Modified:
tomcat/tc6.0.x/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java
Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java?rev=1765964&r1=1765963&r2=1765964&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java Fri Oct 21 09:04:22 2016
@@ -39,9 +39,9 @@ import javax.rmi.ssl.SslRMIServerSocketF
import org.apache.catalina.Lifecycle;
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleListener;
-import org.apache.tomcat.util.res.StringManager;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.res.StringManager;
/**
* This listener fixes the port used by JMX/RMI Server making things much
@@ -52,14 +52,10 @@ import org.apache.juli.logging.LogFactor
*/
public class JmxRemoteLifecycleListener implements LifecycleListener {
- private static Log log =
- LogFactory.getLog(JmxRemoteLifecycleListener.class);
+ private static final Log log = LogFactory.getLog(JmxRemoteLifecycleListener.class);
- /**
- * The string resources for this package.
- */
protected static final StringManager sm =
- StringManager.getManager(Constants.Package);
+ StringManager.getManager(JmxRemoteLifecycleListener.class);
protected int rmiRegistryPortPlatform = -1;
protected int rmiServerPortPlatform = -1;
@@ -151,7 +147,7 @@ public class JmxRemoteLifecycleListener
}
String clientAuthValue = System.getProperty(
- "com.sun.management.jmxremote.ssl.need.client.auth", "true");
+ "com.sun.management.jmxremote.ssl.need.client.auth", "true");
clientAuth = Boolean.parseBoolean(clientAuthValue);
String authenticateValue = System.getProperty(
@@ -173,7 +169,7 @@ public class JmxRemoteLifecycleListener
public void lifecycleEvent(LifecycleEvent event) {
// When the server starts, configure JMX/RMI
- if (Lifecycle.START_EVENT == event.getType()) {
+ if (Lifecycle.START_EVENT.equals(event.getType())) {
// Configure using standard jmx system properties
init();
@@ -215,17 +211,17 @@ public class JmxRemoteLifecycleListener
env.put("jmx.remote.x.login.config", loginModuleName);
}
-
// Create the Platform server
csPlatform = createServer("Platform", rmiRegistryPortPlatform,
rmiServerPortPlatform, env,
ManagementFactory.getPlatformMBeanServer());
- } else if (Lifecycle.STOP_EVENT == event.getType()) {
+ } else if (Lifecycle.STOP_EVENT.equals(event.getType())) {
destroyServer("Platform", csPlatform);
}
}
+
private JMXConnectorServer createServer(String serverName,
int theRmiRegistryPort, int theRmiServerPort,
HashMap<String,Object> theEnv, MBeanServer theMBeanServer) {
@@ -274,6 +270,7 @@ public class JmxRemoteLifecycleListener
return cs;
}
+
private void destroyServer(String serverName,
JMXConnectorServer theConnectorServer) {
if (theConnectorServer != null) {
@@ -287,11 +284,15 @@ public class JmxRemoteLifecycleListener
}
}
+
public static class RmiClientLocalhostSocketFactory
- implements RMIClientSocketFactory, Serializable {
+ implements RMIClientSocketFactory, Serializable {
+
+ private static final long serialVersionUID = 1L;
+
private static final String FORCED_HOST = "localhost";
- private RMIClientSocketFactory factory = null;
+ private final RMIClientSocketFactory factory;
public RmiClientLocalhostSocketFactory(RMIClientSocketFactory theFactory) {
factory = theFactory;
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org