geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r376849 - in /geronimo/branches/1.0: assemblies/j2ee-installer/ assemblies/j2ee-installer/src/izpack/ assemblies/j2ee-installer/src/var/config/ assemblies/j2ee-jetty-server/ assemblies/j2ee-jetty-server/src/var/config/ assemblies/j2ee-tomca...
Date Fri, 10 Feb 2006 21:06:30 GMT
Author: ammulder
Date: Fri Feb 10 13:06:29 2006
New Revision: 376849

URL: http://svn.apache.org/viewcvs?rev=376849&view=rev
Log:
Make the JMX connector appear in the startup port list (GERONIMO-1349)

Modified:
    geronimo/branches/1.0/assemblies/j2ee-installer/project.properties
    geronimo/branches/1.0/assemblies/j2ee-installer/src/izpack/izpack-user-input.xml
    geronimo/branches/1.0/assemblies/j2ee-installer/src/var/config/config.xml
    geronimo/branches/1.0/assemblies/j2ee-jetty-server/project.properties
    geronimo/branches/1.0/assemblies/j2ee-jetty-server/src/var/config/config.xml
    geronimo/branches/1.0/assemblies/j2ee-tomcat-server/project.properties
    geronimo/branches/1.0/assemblies/j2ee-tomcat-server/src/var/config/config.xml
    geronimo/branches/1.0/modules/jmx-remoting/src/java/org/apache/geronimo/jmxremoting/JMXConnector.java

Modified: geronimo/branches/1.0/assemblies/j2ee-installer/project.properties
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/assemblies/j2ee-installer/project.properties?rev=376849&r1=376848&r2=376849&view=diff
==============================================================================
--- geronimo/branches/1.0/assemblies/j2ee-installer/project.properties (original)
+++ geronimo/branches/1.0/assemblies/j2ee-installer/project.properties Fri Feb 10 13:06:29
2006
@@ -42,3 +42,4 @@
 PlanHTTPPortSecondary=8090
 PlanHTTPSPortSecondary=8453
 PlanAJPPortSecondary=8019
+PlanJMXPort=9999

Modified: geronimo/branches/1.0/assemblies/j2ee-installer/src/izpack/izpack-user-input.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/assemblies/j2ee-installer/src/izpack/izpack-user-input.xml?rev=376849&r1=376848&r2=376849&view=diff
==============================================================================
--- geronimo/branches/1.0/assemblies/j2ee-installer/src/izpack/izpack-user-input.xml (original)
+++ geronimo/branches/1.0/assemblies/j2ee-installer/src/izpack/izpack-user-input.xml Fri Feb
10 13:06:29 2006
@@ -31,6 +31,12 @@
             <validator class="com.izforge.izpack.util.NotEmptyValidator"/>
             <createForPack name="J2EE Features"/>
         </field>
+        <field type="rule" variable="PlanJMXPort">
+            <description txt="The network port that should be used for remote JMX management"/>
+            <spec txt="Remote Mgmt Port [9999]:" layout="N:5:5" set="0:9999"/>
+            <validator class="com.izforge.izpack.util.NotEmptyValidator"/>
+            <createForPack name="J2EE Features"/>
+        </field>
         <field type="check" variable="J2EE.Features.enable">
             <description txt="Active at runtime"/>
             <!--description align="left" txt="Enable J2EE features"

Modified: geronimo/branches/1.0/assemblies/j2ee-installer/src/var/config/config.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/assemblies/j2ee-installer/src/var/config/config.xml?rev=376849&r1=376848&r2=376849&view=diff
==============================================================================
--- geronimo/branches/1.0/assemblies/j2ee-installer/src/var/config/config.xml (original)
+++ geronimo/branches/1.0/assemblies/j2ee-installer/src/var/config/config.xml Fri Feb 10 13:06:29
2006
@@ -27,8 +27,8 @@
             <attribute name="host">${PlanServerHostname}</attribute>
             <attribute name="port">${PlanRemoteLoginPort}</attribute>
         </gbean>
-        <gbean name="JMXConnector">
-            <attribute name="url">service:jmx:rmi://${PlanServerHostname}/jndi/rmi:/JMXConnector</attribute>
+        <gbean name="JMXService">
+            <attribute name="url">service:jmx:rmi://${PlanServerHostname}:${PlanJMXPort}/jndi/rmi://${PlanServerHostname}:${PlanNamingPort}/JMXConnector</attribute>
         </gbean>
     </configuration>
     <configuration name="geronimo/j2ee-corba/${pom.currentVersion}/car" load="${CORBA.Features.enable}">

Modified: geronimo/branches/1.0/assemblies/j2ee-jetty-server/project.properties
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/assemblies/j2ee-jetty-server/project.properties?rev=376849&r1=376848&r2=376849&view=diff
==============================================================================
--- geronimo/branches/1.0/assemblies/j2ee-jetty-server/project.properties (original)
+++ geronimo/branches/1.0/assemblies/j2ee-jetty-server/project.properties Fri Feb 10 13:06:29
2006
@@ -42,3 +42,4 @@
 PlanHTTPPortSecondary=8090
 PlanHTTPSPortSecondary=8453
 PlanAJPPortSecondary=8019
+PlanJMXPort=9999

Modified: geronimo/branches/1.0/assemblies/j2ee-jetty-server/src/var/config/config.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/assemblies/j2ee-jetty-server/src/var/config/config.xml?rev=376849&r1=376848&r2=376849&view=diff
==============================================================================
--- geronimo/branches/1.0/assemblies/j2ee-jetty-server/src/var/config/config.xml (original)
+++ geronimo/branches/1.0/assemblies/j2ee-jetty-server/src/var/config/config.xml Fri Feb 10
13:06:29 2006
@@ -28,7 +28,7 @@
             <attribute name="port">${PlanRemoteLoginPort}</attribute>
         </gbean>
         <gbean name="JMXService">
-            <attribute name="url">service:jmx:rmi:///jndi/rmi://${PlanServerHostname}:${PlanNamingPort}/JMXConnector</attribute>
+            <attribute name="url">service:jmx:rmi://${PlanServerHostname}:${PlanJMXPort}/jndi/rmi://${PlanServerHostname}:${PlanNamingPort}/JMXConnector</attribute>
         </gbean>
     </configuration>
     <configuration name="geronimo/j2ee-corba/${pom.currentVersion}/car" load="false">

Modified: geronimo/branches/1.0/assemblies/j2ee-tomcat-server/project.properties
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/assemblies/j2ee-tomcat-server/project.properties?rev=376849&r1=376848&r2=376849&view=diff
==============================================================================
--- geronimo/branches/1.0/assemblies/j2ee-tomcat-server/project.properties (original)
+++ geronimo/branches/1.0/assemblies/j2ee-tomcat-server/project.properties Fri Feb 10 13:06:29
2006
@@ -42,3 +42,4 @@
 PlanHTTPPortSecondary=8090
 PlanHTTPSPortSecondary=8453
 PlanAJPPortSecondary=8019
+PlanJMXPort=9999

Modified: geronimo/branches/1.0/assemblies/j2ee-tomcat-server/src/var/config/config.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/assemblies/j2ee-tomcat-server/src/var/config/config.xml?rev=376849&r1=376848&r2=376849&view=diff
==============================================================================
--- geronimo/branches/1.0/assemblies/j2ee-tomcat-server/src/var/config/config.xml (original)
+++ geronimo/branches/1.0/assemblies/j2ee-tomcat-server/src/var/config/config.xml Fri Feb
10 13:06:29 2006
@@ -28,7 +28,7 @@
             <attribute name="port">${PlanRemoteLoginPort}</attribute>
         </gbean>
         <gbean name="JMXService">
-            <attribute name="url">service:jmx:rmi:///jndi/rmi://${PlanServerHostname}:${PlanNamingPort}/JMXConnector</attribute>
+            <attribute name="url">service:jmx:rmi://${PlanServerHostname}:${PlanJMXPort}/jndi/rmi://${PlanServerHostname}:${PlanNamingPort}/JMXConnector</attribute>
         </gbean>
     </configuration>
     <configuration name="geronimo/j2ee-corba/${pom.currentVersion}/car" load="false">

Modified: geronimo/branches/1.0/modules/jmx-remoting/src/java/org/apache/geronimo/jmxremoting/JMXConnector.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/modules/jmx-remoting/src/java/org/apache/geronimo/jmxremoting/JMXConnector.java?rev=376849&r1=376848&r2=376849&view=diff
==============================================================================
--- geronimo/branches/1.0/modules/jmx-remoting/src/java/org/apache/geronimo/jmxremoting/JMXConnector.java
(original)
+++ geronimo/branches/1.0/modules/jmx-remoting/src/java/org/apache/geronimo/jmxremoting/JMXConnector.java
Fri Feb 10 13:06:29 2006
@@ -16,14 +16,16 @@
  */
 package org.apache.geronimo.jmxremoting;
 
+import java.net.InetSocketAddress;
+import java.net.MalformedURLException;
 import java.util.HashMap;
 import java.util.Map;
 import javax.management.remote.JMXConnectorServer;
 import javax.management.remote.JMXConnectorServerFactory;
+import javax.management.remote.JMXConnectorServerMBean;
 import javax.management.remote.JMXServiceURL;
 import javax.management.remote.JMXConnectionNotification;
 import javax.management.MBeanServer;
-import javax.management.NotificationFilter;
 import javax.management.NotificationFilterSupport;
 
 import org.apache.commons.logging.Log;
@@ -48,7 +50,7 @@
     private Authenticator authenticator;
 
     private JMXConnectorServer server;
-
+    
     /**
      * Constructor for creating the connector. The ClassLoader must be
      * able to load all the LoginModules used in the JAAS login
@@ -86,6 +88,58 @@
     }
 
     /**
+     * Every connector must specify a property of type InetSocketAddress
+     * because we use that to identify the network services to print a list
+     * during startup.  However, this can be read-only since the host and port
+     * are set in the url attribute.
+     */
+    public InetSocketAddress getListenAddress() {
+        return new InetSocketAddress(getHost(), getPort());
+    }    
+    
+    /**
+     * Return the JMX host (extracted from the JMX URL) for this connector.
+     *
+     * @return the JMX host for this connector
+     */
+    public String getHost() {
+        if (server != null )
+            return server.getAddress().getHost();
+        else if (url != null && url.length() != 0) {
+            // server not started so get host from url attribute
+            try {
+                JMXServiceURL serviceURL = new JMXServiceURL(url);
+                return serviceURL.getHost();
+            }
+            catch (MalformedURLException e){
+                return "unknown-host";
+            }
+        } else
+            return "unknown-host";
+    }      
+    
+    /**
+     * Return the JMX port (extracted from the JMX URL) for this connector.
+     *
+     * @return the JMX port for this connector
+     */
+    public int getPort() {
+        if (server != null )
+            return server.getAddress().getPort();
+        else if (url != null && url.length() != 0) {
+            // server not started so get port from url attribute
+            try {
+                JMXServiceURL serviceURL = new JMXServiceURL(url);
+                return serviceURL.getPort();
+            }
+            catch (MalformedURLException e){
+                return 0;
+            }
+        } else
+            return 0;
+    }    
+    
+    /**
      * Return the JMX URL for this connector.
      *
      * @return the JMX URL for this connector
@@ -150,12 +204,13 @@
     public static final GBeanInfo GBEAN_INFO;
 
     static {
-        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(JMXConnector.class);
//TODO just  a gbean?
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic("JMX Remoting Connector",
JMXConnector.class); //TODO just  a gbean?
         infoFactory.addAttribute("url", String.class, true, true);
         infoFactory.addAttribute("applicationConfigName", String.class, true, true);
         infoFactory.addAttribute("kernel", Kernel.class, false);
         infoFactory.addAttribute("objectName", String.class, false);
         infoFactory.addAttribute("classLoader", ClassLoader.class, false);
+        infoFactory.addAttribute("listenAddress", InetSocketAddress.class, false);
         infoFactory.setConstructor(new String[]{"kernel", "objectName", "classLoader"});
         GBEAN_INFO = infoFactory.getBeanInfo();
     }



Mime
View raw message