Tomcat uses Platform MBean server. Adjust listener accordingly.
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 8 Mar 2009 18:46:51 +0000 (18:46 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 8 Mar 2009 18:46:51 +0000 (18:46 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@751496 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java
webapps/docs/config/listeners.xml

index ebc8fbf..6f2e3dd 100644 (file)
@@ -67,8 +67,6 @@ public class JmxRemoteLifecycleListener implements LifecycleListener {
 
     protected int rmiRegistryPortPlatform = -1;
     protected int rmiServerPortPlatform = -1;
-    protected int rmiRegistryPortCatalina = -1;
-    protected int rmiServerPortCatalina = -1;
     protected boolean rmiSSL = true;
     protected String ciphers[] = null;
     protected String protocols[] = null;
@@ -79,7 +77,6 @@ public class JmxRemoteLifecycleListener implements LifecycleListener {
     protected boolean useLocalPorts = false;
 
     protected JMXConnectorServer csPlatform = null;
-    protected JMXConnectorServer csCatalina = null;
     
     /**
      * Get the port on which the Platform RMI server is exported. This is the
@@ -116,40 +113,6 @@ public class JmxRemoteLifecycleListener implements LifecycleListener {
     }
     
     /**
-     * Get the port on which the Catalina RMI server is exported. This is the
-     * port that is normally chosen by the RMI stack.
-     * @returns The port number
-     */
-    public int getRmiServerPortCatalina() {
-        return rmiServerPortCatalina;
-    }
-    
-    /**
-     * Set the port on which the Catalina RMI server is exported. This is the
-     * port that is normally chosen by the RMI stack.
-     * @param theRmiServerPortCatalina The port number
-     */
-    public void setRmiServerPortCatalina(int theRmiServerPortCatalina) {
-        rmiServerPortCatalina = theRmiServerPortCatalina;
-    }
-    
-    /**
-     * Get the port on which the Catalina RMI registry is exported.
-     * @returns The port number
-     */
-    public int getRmiRegistryPortCatalina() {
-        return rmiRegistryPortCatalina;
-    }
-    
-    /**
-     * Set the port on which the Catalina RMI registry is exported.
-     * @param theRmiRegistryPortCatalina The port number
-     */
-    public void setRmiRegistryPortCatalina(int theRmiRegistryPortCatalina) {
-        rmiRegistryPortCatalina = theRmiRegistryPortCatalina;
-    }
-    
-    /**
      * Get the flag that indicates that local ports should be used for all
      * connections. If using SSH tunnels, or similar, this should be set to
      * true to ensure the RMI client uses the tunnel.
@@ -257,13 +220,8 @@ public class JmxRemoteLifecycleListener implements LifecycleListener {
                     rmiServerPortPlatform, env,
                     ManagementFactory.getPlatformMBeanServer());
             
-            // Create the catalina server
-            csCatalina = createServer("Catalina", rmiRegistryPortCatalina,
-                    rmiServerPortCatalina, env,
-                    MBeanUtils.createServer());
         } else if (Lifecycle.STOP_EVENT == event.getType()) {
             destroyServer("Platform", csPlatform);
-            destroyServer("Catalina", csCatalina);
         }
     }
 
index ffa0eb8..f9aaae2 100644 (file)
     in <code>$CATALINA_HOME/lib</code>. This jar may be found in the extras
     directory of the binary download area.</p>
 
-    <p>The <strong>JMX Remote Lifecycle Listener</strong> fixes the port used by
+    <p>The <strong>JMX Remote Lifecycle Listener</strong> fixes the ports used by
     the JMX/RMI Server making things much simpler if you need to connect
     jconsole or a similar tool to a remote Tomcat instance that is running
-    behind a firewall. Only this port is configured via the listener. The
+    behind a firewall. Only these ports are configured via the listener. The
     remainder of the configuration is via the standard system properties for
     configuring JMX. For further information on configuring JMX see
     <a href="http://java.sun.com/j2se/1.6.0/docs/guide/management/agent.html">
     <p>If this listener was configured in server.xml as:
 <source>
 &lt;Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener"
-          rmiRegistryPortPlatform="10001" rmiServerPortPlatform="10002"
-          rmiRegistryPortCatalina="10003" rmiServerPortCatalina="10004" /&gt;
+          rmiRegistryPortPlatform="10001" rmiServerPortPlatform="10002" /&gt;
 </source>
     with the following system properties set (eg in setenv.sh):
 <source>
     behind a firewall.
     </p>
     
-    <p><strong>JMX access should be considered equivalent to administartive
+    <p><strong>JMX access should be considered equivalent to administrative
     access and secured accordingly.</strong></p>
 
-    <p>This listener must only be nested within <a href="server.html">Server</a>
-    elements.</p>
+    <p>This listener must only be nested within <a href="server.html">Server</a>
+    element.</p>
 
     <p>The following additional attributes are support by the <strong>JMX Remote
     Lifecycle Listener</strong>:</p>
         <p>The port to be used by the Platform JMX/RMI server.</p>
       </attribute>
 
-      <attribute name="rmiRegsitryPortCatalina" required="true">
-        <p>The port to be used by the JMX/RMI registry for the Catalina MBeans.
-        The replaces the use of the
-        <code>com.sun.management.jmxremote.port</code> system property that
-        should not be set when using this valve.</p>
-      </attribute>
-
-      <attribute name="rmiServerPortCatalina" required="true">
-        <p>The port to be used by the Catalina JMX/RMI server.</p>
-      </attribute>
-
       <attribute name="useLocalPorts" required="false">
         <p>Should any clients using these ports be forced to use local ports to
         connect to the the JMX/RMI server. This is useful when tunnelling