geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r395155 [1/2] - in /geronimo/branches/1.1: applications/console-core/src/java/org/apache/geronimo/console/util/ applications/console-standard/src/java/org/apache/geronimo/console/internaldb/ applications/console-standard/src/java/org/apache...
Date Wed, 19 Apr 2006 06:44:28 GMT
Author: dain
Date: Tue Apr 18 23:44:24 2006
New Revision: 395155

URL: http://svn.apache.org/viewcvs?rev=395155&view=rev
Log:
Fixed bugs with JMX bridge
All GBeans can now be inspected using jconsole in java 5

Added:
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/ObjectNameUtil.java
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXProxyManager.java   (with props)
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXProxyMethodInterceptor.java   (with props)
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXUtil.java   (with props)
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/KernelDelegate.java   (with props)
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/KernelMBeanServer.java   (with props)
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/KernelMBeanServerReference.java
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/MBeanServerReference.java
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/RealMBeanServerReference.java
Removed:
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/
Modified:
    geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/JMSConnectionFactoryManagerPortlet.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/SecurityRealmBean.java
    geronimo/branches/1.1/assemblies/j2ee-jetty-server/src/var/config/config.xml
    geronimo/branches/1.1/assemblies/j2ee-tomcat-server/src/var/config/config.xml
    geronimo/branches/1.1/configs/j2ee-security/project.properties
    geronimo/branches/1.1/configs/j2ee-security/src/plan/plan.xml
    geronimo/branches/1.1/configs/j2ee-server/src/plan/plan.xml
    geronimo/branches/1.1/configs/j2ee-system/src/plan/plan.xml
    geronimo/branches/1.1/configs/rmi-naming/src/plan/plan.xml
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/JCAConnectionFactoryImpl.java
    geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java
    geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java
    geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/StopServer.java
    geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEAppClientModuleImpl.java
    geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEApplicationImpl.java
    geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEDomainImpl.java
    geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java
    geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/JVMImpl.java
    geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/mejb/MEJB.java
    geronimo/branches/1.1/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/Abstract77Test.java
    geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
    geronimo/branches/1.1/modules/jmx-remoting/project.xml
    geronimo/branches/1.1/modules/jmx-remoting/src/java/org/apache/geronimo/jmxremoting/JMXConnector.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicLifecycleMonitor.java
    geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/GBeanTest.java
    geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingServer.java
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/MBeanServerKernelBridge.java
    geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
    geronimo/branches/1.1/plugins/geronimo-deployment-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/StopRemoteServer.java
    geronimo/branches/1.1/plugins/geronimo-deployment-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/WaitForStarted.java

Modified: geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java (original)
+++ geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java Tue Apr 18 23:44:24 2006
@@ -867,7 +867,7 @@
         javax.management.remote.JMXServiceURL address = new javax.management.remote.JMXServiceURL("service:" + uri);
         javax.management.remote.JMXConnector jmxConnector = javax.management.remote.JMXConnectorFactory.connect(address, environment);
         javax.management.MBeanServerConnection mbServerConnection = jmxConnector.getMBeanServerConnection();
-        Kernel kernel = new org.apache.geronimo.kernel.jmx.KernelDelegate(mbServerConnection);
+        Kernel kernel = new org.apache.geronimo.system.jmx.KernelDelegate(mbServerConnection);
         return new KernelManagementHelper(kernel);
     }
 }

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java Tue Apr 18 23:44:24 2006
@@ -26,7 +26,7 @@
 
 import org.apache.geronimo.console.GeronimoVersion;
 import org.apache.geronimo.kernel.KernelRegistry;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.kernel.ObjectNameUtil;
 
 /**
  * A static class to handle retreiving connections. This class is built to
@@ -53,7 +53,7 @@
 
     private static final String EMPTY_PROPS = "";
 
-    private static final ObjectName SYSTEM_DATASOURCE_NAME = JMXUtil
+    private static final ObjectName SYSTEM_DATASOURCE_NAME = ObjectNameUtil
             .getObjectName("geronimo.server:J2EEApplication=null,J2EEServer=geronimo,JCAResource=geronimo/system-database/"+GeronimoVersion.GERONIMO_VERSION+"/car,j2eeType=JCAManagedConnectionFactory,name=SystemDatasource");
 
     /**

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/JMSConnectionFactoryManagerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/JMSConnectionFactoryManagerPortlet.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/JMSConnectionFactoryManagerPortlet.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/JMSConnectionFactoryManagerPortlet.java Tue Apr 18 23:44:24 2006
@@ -25,7 +25,7 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelRegistry;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.kernel.ObjectNameUtil;
 
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
@@ -60,7 +60,7 @@
 
     private final static String SUBMIT_CREATE = "Create";
 
-    private final ObjectName DATABASE_QUERY = JMXUtil
+    private final ObjectName DATABASE_QUERY = ObjectNameUtil
             .getObjectName("*:j2eeType=JCAManagedConnectionFactory,*");
 
     protected final String NORMAL_VIEW = "/WEB-INF/view/jmsmanager/activemq/normal.jsp";;

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/SecurityRealmBean.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/SecurityRealmBean.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/SecurityRealmBean.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/SecurityRealmBean.java Tue Apr 18 23:44:24 2006
@@ -21,7 +21,7 @@
 
 import javax.management.ObjectName;
 
-import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.kernel.ObjectNameUtil;
 
 public class SecurityRealmBean {
 
@@ -49,7 +49,7 @@
     public SecurityRealmBean(String realmObjectName, String configEntryObjName,
             String configID, String applicationConfigName, String realmName,
             boolean started, Map attributes) {
-        this(JMXUtil.getObjectName(realmObjectName), JMXUtil
+        this(ObjectNameUtil.getObjectName(realmObjectName), ObjectNameUtil
                 .getObjectName(configEntryObjName), configID,
                 applicationConfigName, realmName, started, attributes);
     }

Modified: geronimo/branches/1.1/assemblies/j2ee-jetty-server/src/var/config/config.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/assemblies/j2ee-jetty-server/src/var/config/config.xml?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/assemblies/j2ee-jetty-server/src/var/config/config.xml (original)
+++ geronimo/branches/1.1/assemblies/j2ee-jetty-server/src/var/config/config.xml Tue Apr 18 23:44:24 2006
@@ -28,7 +28,10 @@
             <attribute name="port">${PlanRemoteLoginPort}</attribute>
         </gbean>
         <gbean name="JMXService">
-            <attribute name="url">service:jmx:rmi://${PlanServerHostname}:${PlanJMXPort}/jndi/rmi://${PlanServerHostname}:${PlanNamingPort}/JMXConnector</attribute>
+            <attribute name="protocol">rmi</attribute>
+            <attribute name="host">${PlanServerHostname}</attribute>
+            <attribute name="port">${PlanJMXPort}</attribute>
+            <attribute name="urlPath">/jndi/rmi://${PlanServerHostname}:${PlanNamingPort}/JMXConnector</attribute>
         </gbean>
     </configuration>
     <configuration name="geronimo/j2ee-corba/${pom.currentVersion}/car" load="false">

Modified: geronimo/branches/1.1/assemblies/j2ee-tomcat-server/src/var/config/config.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/assemblies/j2ee-tomcat-server/src/var/config/config.xml?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/assemblies/j2ee-tomcat-server/src/var/config/config.xml (original)
+++ geronimo/branches/1.1/assemblies/j2ee-tomcat-server/src/var/config/config.xml Tue Apr 18 23:44:24 2006
@@ -28,7 +28,10 @@
             <attribute name="port">${PlanRemoteLoginPort}</attribute>
         </gbean>
         <gbean name="JMXService">
-            <attribute name="url">service:jmx:rmi://${PlanServerHostname}:${PlanJMXPort}/jndi/rmi://${PlanServerHostname}:${PlanNamingPort}/JMXConnector</attribute>
+          <attribute name="protocol">rmi</attribute>
+          <attribute name="host">${PlanServerHostname}</attribute>
+          <attribute name="port">${PlanJMXPort}</attribute>
+          <attribute name="urlPath">/jndi/rmi://${PlanServerHostname}:${PlanNamingPort}/JMXConnector</attribute>
         </gbean>
     </configuration>
     <configuration name="geronimo/j2ee-corba/${pom.currentVersion}/car" load="false">

Modified: geronimo/branches/1.1/configs/j2ee-security/project.properties
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/j2ee-security/project.properties?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/j2ee-security/project.properties (original)
+++ geronimo/branches/1.1/configs/j2ee-security/project.properties Tue Apr 18 23:44:24 2006
@@ -28,6 +28,8 @@
 #j2ee-deployer needed for login config xml-reference builder
 geronimo.packaging.deploymentConfig=geronimo/geronimo-gbean-deployer/${geronimo_version}/car,geronimo/j2ee-deployer/${geronimo_version}/car
 
+PlanJMXPort=9999
+PlanNamingPort=1099
 PlanHTTPPort=8080
 PlanHTTPSPort=8443
 PlanOpenEJBPort=4201

Modified: geronimo/branches/1.1/configs/j2ee-security/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/j2ee-security/src/plan/plan.xml?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/j2ee-security/src/plan/plan.xml (original)
+++ geronimo/branches/1.1/configs/j2ee-security/src/plan/plan.xml Tue Apr 18 23:44:24 2006
@@ -59,8 +59,14 @@
 
     <!-- JMX Remoting -->
     <gbean name="JMXService" class="org.apache.geronimo.jmxremoting.JMXConnector">
-        <attribute name="url">service:jmx:rmi://${PlanServerHostname}/jndi/rmi:/JMXConnector</attribute>
+        <attribute name="protocol">rmi</attribute>
+        <attribute name="host">${PlanServerHostname}</attribute>
+        <attribute name="port">${PlanJMXPort}</attribute>
+        <attribute name="urlPath">/jndi/rmi://${PlanServerHostname}:${PlanNamingPort}/JMXConnector</attribute>
         <attribute name="applicationConfigName">JMX</attribute>
+        <reference name="MBeanServerReference">
+            <name>MBeanServerReference</name>
+        </reference>
     </gbean>
 
 

Modified: geronimo/branches/1.1/configs/j2ee-server/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/j2ee-server/src/plan/plan.xml?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/j2ee-server/src/plan/plan.xml (original)
+++ geronimo/branches/1.1/configs/j2ee-server/src/plan/plan.xml Tue Apr 18 23:44:24 2006
@@ -186,7 +186,11 @@
 
     <gbean name="eis/JAXR" class="org.apache.geronimo.webservices.jaxr.JAXRGBean"/>
 
-    <gbean name="ejb/mgmt/MEJB" class="org.openejb.mejb.MEJB"/>
+    <gbean name="ejb/mgmt/MEJB" class="org.openejb.mejb.MEJB">
+        <reference name="MBeanServerReference">
+            <name>MBeanServerReference</name>
+        </reference>
+    </gbean>
 
     <gbean name="AxisCLWorkaround" class="org.apache.geronimo.axis.AxisDiscoveryCLWorkaroundGBean"/>
 

Modified: geronimo/branches/1.1/configs/j2ee-system/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/j2ee-system/src/plan/plan.xml?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/j2ee-system/src/plan/plan.xml (original)
+++ geronimo/branches/1.1/configs/j2ee-system/src/plan/plan.xml Tue Apr 18 23:44:24 2006
@@ -27,9 +27,6 @@
 specific services - those should be provided by children.
 -->
 <configuration xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
-  <!-- MBean server service -->
-  <gbean name="MBeanServerKernelBridge" class="org.apache.geronimo.system.jmx.MBeanServerKernelBridge"/>
-
   <!-- ServerInfo service -->
   <gbean name="ServerInfo" class="org.apache.geronimo.system.serverinfo.BasicServerInfo"/>
 

Modified: geronimo/branches/1.1/configs/rmi-naming/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/rmi-naming/src/plan/plan.xml?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/rmi-naming/src/plan/plan.xml (original)
+++ geronimo/branches/1.1/configs/rmi-naming/src/plan/plan.xml Tue Apr 18 23:44:24 2006
@@ -53,4 +53,12 @@
         </reference>
     </gbean>
 
+    <gbean name="MBeanServerReference" class="org.apache.geronimo.system.jmx.RealMBeanServerReference"/>
+
+    <!-- MBean server service -->
+    <gbean name="MBeanServerKernelBridge" class="org.apache.geronimo.system.jmx.MBeanServerKernelBridge">
+      <reference name="MBeanServerReference">
+        <name>MBeanServerReference</name>
+      </reference>
+    </gbean>
 </configuration>

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java (original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java Tue Apr 18 23:44:24 2006
@@ -27,7 +27,7 @@
 import org.apache.geronimo.management.geronimo.ResourceAdapter;
 import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
 import org.apache.geronimo.j2ee.management.impl.InvalidObjectNameException;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.kernel.ObjectNameUtil;
 
 /**
  * @version $Rev$ $Date$
@@ -64,7 +64,7 @@
                                      String resourceAdapterVersion,
                                      String eisType) {
         this.objectName = objectName;
-        ObjectName myObjectName = JMXUtil.getObjectName(objectName);
+        ObjectName myObjectName = ObjectNameUtil.getObjectName(objectName);
         verifyObjectName(myObjectName);
 
         this.resourceAdapter = resourceAdapter;

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/JCAConnectionFactoryImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/JCAConnectionFactoryImpl.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/JCAConnectionFactoryImpl.java (original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/JCAConnectionFactoryImpl.java Tue Apr 18 23:44:24 2006
@@ -17,7 +17,7 @@
 package org.apache.geronimo.connector.outbound;
 
 import org.apache.geronimo.j2ee.management.impl.InvalidObjectNameException;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.kernel.ObjectNameUtil;
 import org.apache.geronimo.management.geronimo.JCAConnectionFactory;
 import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
 
@@ -33,7 +33,7 @@
 
     public JCAConnectionFactoryImpl(String objectName, JCAManagedConnectionFactory managedConnectionFactory) {
         // todo do we really need to do this at runtime - shouldn't the builder set this up correctly?
-        ObjectName myObjectName = JMXUtil.getObjectName(objectName);
+        ObjectName myObjectName = ObjectNameUtil.getObjectName(objectName);
         verifyObjectName(myObjectName);
 
         this.objectName = objectName;

Modified: geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java (original)
+++ geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java Tue Apr 18 23:44:24 2006
@@ -25,27 +25,25 @@
 import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.Set;
-
+import javax.enterprise.deploy.shared.CommandType;
 import javax.enterprise.deploy.spi.Target;
 import javax.enterprise.deploy.spi.TargetModuleID;
-import javax.enterprise.deploy.spi.status.ProgressListener;
 import javax.enterprise.deploy.spi.status.ProgressEvent;
-import javax.enterprise.deploy.shared.CommandType;
+import javax.enterprise.deploy.spi.status.ProgressListener;
 import javax.management.MBeanServerConnection;
 import javax.management.remote.JMXConnector;
 
+import org.apache.geronimo.deployment.plugin.GeronimoDeploymentManager;
+import org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand;
 import org.apache.geronimo.deployment.plugin.local.DistributeCommand;
 import org.apache.geronimo.deployment.plugin.local.RedeployCommand;
-import org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand;
-import org.apache.geronimo.deployment.plugin.GeronimoDeploymentManager;
 import org.apache.geronimo.deployment.plugin.remote.RemoteDeployUtil;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
-import org.apache.geronimo.kernel.jmx.KernelDelegate;
 import org.apache.geronimo.system.configuration.ConfigurationList;
-import org.apache.geronimo.system.configuration.DownloadResults;
-import org.apache.geronimo.system.configuration.ConfigurationInstaller;
 import org.apache.geronimo.system.configuration.DownloadPoller;
+import org.apache.geronimo.system.configuration.DownloadResults;
+import org.apache.geronimo.system.jmx.KernelDelegate;
 
 /**
  * Connects to a Kernel in a remote VM (may or many not be on the same machine).

Modified: geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java (original)
+++ geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java Tue Apr 18 23:44:24 2006
@@ -19,7 +19,7 @@
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.plugin.TargetModuleIDImpl;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.kernel.ObjectNameUtil;
 
 import javax.enterprise.deploy.shared.CommandType;
 import javax.enterprise.deploy.shared.ModuleType;
@@ -62,7 +62,7 @@
     }
 
     private ObjectName getDeployerName() {
-        Set deployers = kernel.listGBeans(JMXUtil.getObjectName(DEPLOYER_NAME));
+        Set deployers = kernel.listGBeans(ObjectNameUtil.getObjectName(DEPLOYER_NAME));
         if (deployers.isEmpty()) {
             fail("No Deployer GBean present in running Geronimo server. " +
                  "This usually indicates a serious problem with the configuration of " +

Modified: geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/StopServer.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/StopServer.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/StopServer.java (original)
+++ geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/StopServer.java Tue Apr 18 23:44:24 2006
@@ -32,7 +32,7 @@
 
 import org.apache.geronimo.deployment.cli.ServerConnection.PasswordPrompt;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.jmx.KernelDelegate;
+import org.apache.geronimo.system.jmx.KernelDelegate;
 
 /**
  * @version $Rev$ $Date$

Modified: geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEAppClientModuleImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEAppClientModuleImpl.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEAppClientModuleImpl.java (original)
+++ geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEAppClientModuleImpl.java Tue Apr 18 23:44:24 2006
@@ -25,7 +25,7 @@
 import org.apache.geronimo.management.J2EEServer;
 import org.apache.geronimo.management.AppClientModule;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.kernel.ObjectNameUtil;
 
 /**
  * @version $Revision$ $Date$
@@ -39,7 +39,7 @@
 
     public J2EEAppClientModuleImpl(String objectName, J2EEServer server, J2EEApplication application, String deploymentDescriptor, ClassLoader classLoader) {
         this.objectName = objectName;
-        ObjectName myObjectName = JMXUtil.getObjectName(this.objectName);
+        ObjectName myObjectName = ObjectNameUtil.getObjectName(this.objectName);
         verifyObjectName(myObjectName);
 
         this.server = server;

Modified: geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEApplicationImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEApplicationImpl.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEApplicationImpl.java (original)
+++ geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEApplicationImpl.java Tue Apr 18 23:44:24 2006
@@ -22,7 +22,7 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.kernel.ObjectNameUtil;
 import org.apache.geronimo.management.AppClientModule;
 import org.apache.geronimo.management.EJBModule;
 import org.apache.geronimo.management.J2EEModule;
@@ -44,7 +44,7 @@
 
     public J2EEApplicationImpl(Kernel kernel, String objectName, J2EEServer server, String deploymentDescriptor) {
         this.objectName = objectName;
-        ObjectName myObjectName = JMXUtil.getObjectName(this.objectName);
+        ObjectName myObjectName = ObjectNameUtil.getObjectName(this.objectName);
         verifyObjectName(myObjectName);
 
         // build the base name used to query the server for child modules

Modified: geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEDomainImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEDomainImpl.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEDomainImpl.java (original)
+++ geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEDomainImpl.java Tue Apr 18 23:44:24 2006
@@ -23,7 +23,7 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.kernel.ObjectNameUtil;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.management.geronimo.J2EEDomain;
 import org.apache.geronimo.management.geronimo.J2EEServer;
@@ -38,7 +38,7 @@
 
     public J2EEDomainImpl(Kernel kernel, String objectName) {
         this.objectName = objectName;
-        ObjectName myObjectName = JMXUtil.getObjectName(this.objectName);
+        ObjectName myObjectName = ObjectNameUtil.getObjectName(this.objectName);
         verifyObjectName(myObjectName);
         baseName = myObjectName.getDomain() + ":";
 

Modified: geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java (original)
+++ geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java Tue Apr 18 23:44:24 2006
@@ -28,9 +28,9 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.ObjectNameUtil;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.kernel.proxy.ProxyManager;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.management.J2EEDeployedObject;
@@ -59,7 +59,7 @@
 
     public J2EEServerImpl(Kernel kernel, String objectName, ServerInfo serverInfo) {
         this.objectName = objectName;
-        ObjectName myObjectName = JMXUtil.getObjectName(this.objectName);
+        ObjectName myObjectName = ObjectNameUtil.getObjectName(this.objectName);
         verifyObjectName(myObjectName);
 
         // build the base name used to query the server for child modules

Modified: geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/JVMImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/JVMImpl.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/JVMImpl.java (original)
+++ geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/JVMImpl.java Tue Apr 18 23:44:24 2006
@@ -33,7 +33,7 @@
 import org.apache.geronimo.management.stats.JVMStatsImpl;
 import org.apache.geronimo.management.stats.BoundedRangeImpl;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.kernel.ObjectNameUtil;
 import org.apache.commons.logging.LogFactory;
 import org.apache.commons.logging.Log;
 
@@ -67,7 +67,7 @@
     public JVMImpl(String objectName, Kernel kernel) {
         this.objectName = objectName;
         this.kernel = kernel;
-        ObjectName myObjectName = JMXUtil.getObjectName(this.objectName);
+        ObjectName myObjectName = ObjectNameUtil.getObjectName(this.objectName);
         verifyObjectName(myObjectName);
 
         // build the base name used to query the server for related modules

Modified: geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/mejb/MEJB.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/mejb/MEJB.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/mejb/MEJB.java (original)
+++ geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/mejb/MEJB.java Tue Apr 18 23:44:24 2006
@@ -38,8 +38,7 @@
 
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.jmx.MBeanServerDelegate;
+import org.apache.geronimo.system.jmx.MBeanServerReference;
 import org.apache.geronimo.management.J2EEManagedObject;
 
 /**
@@ -48,12 +47,17 @@
  * @version $Rev$ $Date$
  */
 public class MEJB implements Management {
-    private final MBeanServer mbeanServer;
     private final String objectName;
+    private final MBeanServer mbeanServer;
+
+    // todo remove this as soon as Geronimo supports factory beans
+    public MEJB(String objectName, MBeanServerReference mbeanServerReference) {
+        this(objectName, mbeanServerReference.getMBeanServer());
+    }
 
-    public MEJB(String objectName, Kernel kernel) {
-        mbeanServer = new MBeanServerDelegate(kernel);
+    public MEJB(String objectName, MBeanServer mbeanServer) {
         this.objectName = objectName;
+        this.mbeanServer = mbeanServer;
     }
 
     public MBeanInfo getMBeanInfo(ObjectName objectName) throws InstanceNotFoundException, IntrospectionException, ReflectionException {
@@ -142,11 +146,11 @@
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(MEJB.class);
         infoBuilder.addAttribute("objectName", String.class, false);
-        infoBuilder.addAttribute("kernel", Kernel.class, false);
+        infoBuilder.addReference("MBeanServerReference", MBeanServerReference.class);
         infoBuilder.addInterface(Management.class);
         infoBuilder.addInterface(J2EEManagedObject.class);
 
-        infoBuilder.setConstructor(new String[]{"objectName", "kernel"});
+        infoBuilder.setConstructor(new String[]{"objectName", "MBeanServerReference"});
 
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }

Modified: geronimo/branches/1.1/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/Abstract77Test.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/Abstract77Test.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/Abstract77Test.java (original)
+++ geronimo/branches/1.1/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/Abstract77Test.java Tue Apr 18 23:44:24 2006
@@ -21,6 +21,7 @@
 import java.util.Set;
 import java.util.Hashtable;
 import javax.management.ObjectName;
+import javax.management.MalformedObjectNameException;
 
 import junit.framework.TestCase;
 import org.apache.geronimo.gbean.GBeanData;
@@ -32,7 +33,6 @@
 import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 import org.apache.log4j.Logger;
 import org.apache.log4j.Level;
@@ -40,7 +40,7 @@
 import org.apache.log4j.PatternLayout;
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 386505 $ $Date$
  */
 public abstract class Abstract77Test extends TestCase {
     protected static final GBeanData SERVER_INFO_DATA = buildGBeanData(new String[] {"role"}, new String[] {"ServerInfo"}, BasicServerInfo.getGBeanInfo());
@@ -64,7 +64,14 @@
             String v = value[i];
             names.put(k, v);
         }
-        return new AbstractName(new Artifact("test", "foo", "1", "car"), names, JMXUtil.getObjectName(DOMAIN, names));
+
+        ObjectName objectName;
+        try {
+            objectName = new ObjectName(DOMAIN, names);
+        } catch (MalformedObjectNameException e) {
+            throw new IllegalArgumentException("Malformed ObjectName: " + DOMAIN + ":" + names);
+        }
+        return new AbstractName(new Artifact("test", "foo", "1", "car"), names, objectName);
     }
 
     protected void setUp() throws Exception {

Modified: geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java (original)
+++ geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java Tue Apr 18 23:44:24 2006
@@ -33,7 +33,7 @@
 import org.apache.geronimo.jetty.interceptor.TransactionContextBeforeAfter;
 import org.apache.geronimo.jetty.interceptor.WebApplicationContextBeforeAfter;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.kernel.ObjectNameUtil;
 import org.apache.geronimo.management.J2EEApplication;
 import org.apache.geronimo.management.J2EEServer;
 import org.apache.geronimo.management.geronimo.WebModule;
@@ -62,7 +62,6 @@
 import javax.management.MalformedObjectNameException;
 import javax.naming.Context;
 import java.io.IOException;
-import java.net.URI;
 import java.net.URL;
 import java.security.PermissionCollection;
 import java.util.Collection;
@@ -206,7 +205,7 @@
         this.application = application;
         this.objectName = objectName;
         if (objectName != null) {
-            ObjectName myObjectName = JMXUtil.getObjectName(objectName);
+            ObjectName myObjectName = ObjectNameUtil.getObjectName(objectName);
             verifyObjectName(myObjectName);
         }
         this.configurationBaseURL = configurationBaseUrl;

Modified: geronimo/branches/1.1/modules/jmx-remoting/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jmx-remoting/project.xml?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jmx-remoting/project.xml (original)
+++ geronimo/branches/1.1/modules/jmx-remoting/project.xml Tue Apr 18 23:44:24 2006
@@ -48,6 +48,12 @@
         </dependency>
 
         <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-system</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
             <groupId>mx4j</groupId>
             <artifactId>mx4j</artifactId>
             <version>${mx4j_version}</version>

Modified: geronimo/branches/1.1/modules/jmx-remoting/src/java/org/apache/geronimo/jmxremoting/JMXConnector.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jmx-remoting/src/java/org/apache/geronimo/jmxremoting/JMXConnector.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jmx-remoting/src/java/org/apache/geronimo/jmxremoting/JMXConnector.java (original)
+++ geronimo/branches/1.1/modules/jmx-remoting/src/java/org/apache/geronimo/jmxremoting/JMXConnector.java Tue Apr 18 23:44:24 2006
@@ -17,12 +17,10 @@
 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;
@@ -33,8 +31,7 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
-import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.jmx.MBeanServerDelegate;
+import org.apache.geronimo.system.jmx.MBeanServerReference;
 
 /**
  * A Connector that supports the server sideof JSR 160 JMX Remoting.
@@ -42,25 +39,35 @@
  * @version $Rev$ $Date$
  */
 public class JMXConnector implements GBeanLifecycle {
-    private final Kernel kernel;
+    private final MBeanServer mbeanServer;
     private final Log log;
     private final ClassLoader classLoader;
-    private String url;
     private String applicationConfigName;
     private Authenticator authenticator;
 
+    private String protocol;
+    private String host;
+    private int port = -1;
+    private String urlPath;
+
     private JMXConnectorServer server;
-    
+    private JMXServiceURL jmxServiceURL;
+
+    // todo remove this as soon as Geronimo supports factory beans
+    public JMXConnector(MBeanServerReference mbeanServerReference, String objectName, ClassLoader classLoader) {
+        this(mbeanServerReference.getMBeanServer(), objectName, classLoader);
+    }
+
     /**
      * Constructor for creating the connector. The ClassLoader must be
      * able to load all the LoginModules used in the JAAS login
      *
-     * @param kernel a reference to the kernel
+     * @param mbeanServer the mbean server
      * @param objectName this connector's object name
      * @param classLoader the classLoader used to create this connector
      */
-    public JMXConnector(Kernel kernel, String objectName, ClassLoader classLoader) {
-        this.kernel = kernel;
+    public JMXConnector(MBeanServer mbeanServer, String objectName, ClassLoader classLoader) {
+        this.mbeanServer = mbeanServer;
         this.classLoader = classLoader;
         log = LogFactory.getLog(objectName);
     }
@@ -95,79 +102,86 @@
      */
     public InetSocketAddress getListenAddress() {
         return new InetSocketAddress(getHost(), getPort());
-    }    
-    
+    }
+
+    /**
+     * Gets the protocol to use for the connection.
+     * @return the protocol to use for the connection
+     */
+    public String getProtocol() {
+        return protocol;
+    }
+
+    /**
+     * Sets the protocol to use for the connection.
+     * @param protocol the protocol to use for the connection
+     */
+    public void setProtocol(String protocol) {
+        this.protocol = protocol;
+    }
+
     /**
-     * Return the JMX host (extracted from the JMX URL) for this connector.
+     * Gets the JMX host 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 host;
+    }
+
     /**
-     * Return the JMX port (extracted from the JMX URL) for this connector.
+     * Sets the JMX host for this connector.
+     * @param host the JMX host for this connector
+     */
+    public void setHost(String host) {
+        this.host = host;
+    }
+
+    /**
+     * Gets the JMX port 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 port;
+    }
+
     /**
-     * Return the JMX URL for this connector.
-     *
-     * @return the JMX URL for this connector
+     * Sets the JMX port for this connector.
+     * @param port the JMX port for this connector
      */
-    public String getUrl() {
-        return url;
+    public void setPort(int port) {
+        this.port = port;
     }
 
     /**
-     * Set the JMX URL for this connector
-     *
-     * @param url the JMX URL for this connector
+     * Gets the path within the target server to look for the connection.  This is commonly
+     * /jndi/rmi://localhost:1099/JMXConnector
+     * @return the path used to loacate the connector on the target server
      */
-    public void setUrl(String url) {
-        this.url = url;
+    public String getUrlPath() {
+        return urlPath;
+    }
+
+    /**
+     * Sets the path within the target server to look for the connection.  This is commonly
+     * /jndi/rmi://localhost:1099/JMXConnector
+     * @param urlPath the path used to loacate the connector on the target server
+     */
+    public void setUrlPath(String urlPath) {
+        this.urlPath = urlPath;
     }
 
     public void doStart() throws Exception {
-        JMXServiceURL serviceURL = new JMXServiceURL(url);
+        jmxServiceURL = new JMXServiceURL(protocol, host, port, urlPath);
         Map env = new HashMap();
         if (applicationConfigName != null) {
             authenticator = new Authenticator(applicationConfigName, classLoader);
             env.put(JMXConnectorServer.AUTHENTICATOR, authenticator);
         } else {
-            log.warn("Starting unauthenticating JMXConnector for " + serviceURL);
+            log.warn("Starting unauthenticating JMXConnector for " + jmxServiceURL);
         }
-        MBeanServer mbeanServer = new MBeanServerDelegate(kernel);
-        server = JMXConnectorServerFactory.newJMXConnectorServer(serviceURL, env, mbeanServer);
+        server = JMXConnectorServerFactory.newJMXConnectorServer(jmxServiceURL, env, mbeanServer);
         NotificationFilterSupport filter = new NotificationFilterSupport();
         filter.enableType(JMXConnectionNotification.OPENED);
         filter.enableType(JMXConnectionNotification.CLOSED);
@@ -179,23 +193,23 @@
 
     public void doStop() throws Exception {
         try {
-        	  server.stop();
+              server.stop();
         } catch (java.io.IOException e) {
-        	  // java.io.IOException is expected.
+              // java.io.IOException is expected.
         } catch (Exception e) {
-        	  // Otherwise, something bad happened.  Rethrow the exception.
-        	  throw e;
+              // Otherwise, something bad happened.  Rethrow the exception.
+              throw e;
         }
         finally {
           server = null;
-          log.debug("Stopped JMXConnector " + url);
+          log.debug("Stopped JMXConnector " + jmxServiceURL);
         }
     }
 
     public void doFail() {
         try {
             doStop();
-            log.warn("Failure in JMXConnector " + url);
+            log.warn("Failure in JMXConnector " + jmxServiceURL);
         } catch (Exception e) {
             log.warn("Error stopping JMXConnector after failure", e);
         }
@@ -204,14 +218,18 @@
     public static final GBeanInfo GBEAN_INFO;
 
     static {
-        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);
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic("JMX Remoting Connector", JMXConnector.class);
+        infoFactory.addReference("MBeanServerReference", MBeanServerReference.class);
         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"});
+
+        infoFactory.addAttribute("protocol", String.class, true, true);
+        infoFactory.addAttribute("host", String.class, true, true);
+        infoFactory.addAttribute("port", int.class, true, true);
+        infoFactory.addAttribute("urlPath", String.class, true, true);
+        infoFactory.addAttribute("applicationConfigName", String.class, true, true);
+
+        infoFactory.setConstructor(new String[]{"MBeanServerReference", "objectName", "classLoader"});
         GBEAN_INFO = infoFactory.getBeanInfo();
     }
 

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java Tue Apr 18 23:44:24 2006
@@ -377,7 +377,6 @@
         for (int i = 0; i < references.length; i++) {
             references[i].online();
         }
-        lifecycleBroadcaster.fireLoadedEvent();
     }
 
     public void die() throws GBeanNotFoundException {

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java Tue Apr 18 23:44:24 2006
@@ -25,7 +25,6 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.kernel.lifecycle.LifecycleMonitor;
 import org.apache.geronimo.kernel.proxy.ProxyManager;
 import org.apache.geronimo.kernel.repository.Artifact;
@@ -37,7 +36,7 @@
     /**
      * The JMX name used by a Kernel to register itself when it boots.
      */
-    ObjectName KERNEL = JMXUtil.getObjectName(":role=Kernel");
+    ObjectName KERNEL = ObjectNameUtil.getObjectName(":role=Kernel");
     AbstractName KERNEL_NAME = new AbstractName(new Artifact("geronimo", "boot", "none", "car"), Collections.singletonMap("role", "kernel"), KERNEL);
 
     /**

Added: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/ObjectNameUtil.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/ObjectNameUtil.java?rev=395155&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/ObjectNameUtil.java (added)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/ObjectNameUtil.java Tue Apr 18 23:44:24 2006
@@ -0,0 +1,40 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.kernel;
+
+import javax.management.ObjectName;
+import javax.management.MalformedObjectNameException;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ObjectNameUtil {
+    /**
+     * Convert a String to an ObjectName
+     *
+     * @param name the name
+     * @return the ObjectName from that String
+     * @throws IllegalArgumentException if the name is malformed
+     */
+    public static ObjectName getObjectName(String name) throws IllegalArgumentException {
+        try {
+            return new ObjectName(name);
+        } catch (MalformedObjectNameException e) {
+            throw new IllegalArgumentException("Malformed ObjectName: " + name);
+        }
+    }
+}

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java Tue Apr 18 23:44:24 2006
@@ -32,6 +32,7 @@
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.runtime.GBeanInstance;
+import org.apache.geronimo.gbean.runtime.LifecycleBroadcaster;
 import org.apache.geronimo.kernel.DependencyManager;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
@@ -364,8 +365,10 @@
     public void loadGBean(GBeanData gbeanData, ClassLoader classLoader) throws GBeanAlreadyExistsException, InternalKernelException {
         AbstractName abstractName = gbeanData.getAbstractName();
         Set interfaces = gbeanData.getGBeanInfo().getInterfaces();
-        GBeanInstance gbeanInstance = new GBeanInstance(gbeanData, this, dependencyManager, lifecycleMonitor.createLifecycleBroadcaster(abstractName, interfaces), classLoader);
+        LifecycleBroadcaster lifecycleBroadcaster = lifecycleMonitor.createLifecycleBroadcaster(abstractName, interfaces);
+        GBeanInstance gbeanInstance = new GBeanInstance(gbeanData, this, dependencyManager, lifecycleBroadcaster, classLoader);
         registry.register(gbeanInstance);
+        lifecycleBroadcaster.fireLoadedEvent();        
     }
 
     public void startGBean(AbstractName name) throws GBeanNotFoundException, InternalKernelException, IllegalStateException {

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicLifecycleMonitor.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicLifecycleMonitor.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicLifecycleMonitor.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicLifecycleMonitor.java Tue Apr 18 23:44:24 2006
@@ -36,7 +36,7 @@
 import org.apache.geronimo.gbean.GBeanData;
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 386505 $ $Date$
  */
 public class BasicLifecycleMonitor implements LifecycleMonitor {
     private static final Log log = LogFactory.getLog(BasicLifecycleMonitor.class);

Modified: geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/GBeanTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/GBeanTest.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/GBeanTest.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/GBeanTest.java Tue Apr 18 23:44:24 2006
@@ -30,8 +30,6 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.kernel.jmx.KernelDelegate;
-import org.apache.geronimo.kernel.jmx.MBeanServerDelegate;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.proxy.ProxyFactory;
 import org.apache.geronimo.kernel.proxy.ProxyManager;
@@ -67,16 +65,6 @@
         }
     }
 
-    /**
-     * Test with kernel wrapped in KernelDelegate
-     */
-    private static class JmxKernelLifecycle extends KernelWraper {
-        public Kernel wrap(Kernel kernel) {
-            MBeanServerDelegate mbeanServer = new MBeanServerDelegate(kernel);
-            return new KernelDelegate(mbeanServer);
-        }
-    }
-
     public static Test suite() throws Exception {
         TestSuite suite = new TestSuite();
         TestSuite inner = new TestSuite(GBeanTest.class);
@@ -95,12 +83,6 @@
             }
         });
 
-        suite.addTest(new TestSetup(inner) {
-            protected void setUp() throws Exception {
-                super.setUp();
-                kernelWraper = new JmxKernelLifecycle();
-            }
-        });
         return suite;
     }
 

Modified: geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingServer.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingServer.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingServer.java (original)
+++ geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingServer.java Tue Apr 18 23:44:24 2006
@@ -41,7 +41,7 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.kernel.ObjectNameUtil;
 import org.apache.geronimo.management.geronimo.NetworkConnector;
 import org.apache.geronimo.proxy.ReflexiveInterceptor;
 import org.apache.geronimo.security.jaas.server.JaasLoginServiceMBean;
@@ -56,7 +56,7 @@
  */
 public class JaasLoginServiceRemotingServer implements GBeanLifecycle, NetworkConnector {
 
-    public static final ObjectName REQUIRED_OBJECT_NAME = JMXUtil.getObjectName("geronimo.remoting:target=JaasLoginServiceRemotingServer");
+    public static final ObjectName REQUIRED_OBJECT_NAME = ObjectNameUtil.getObjectName("geronimo.remoting:target=JaasLoginServiceRemotingServer");
 
     private static final Log log = LogFactory.getLog(JaasLoginServiceRemotingServer.class);
     private AsyncChannelServer server;

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java?rev=395155&r1=395154&r2=395155&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java Tue Apr 18 23:44:24 2006
@@ -36,6 +36,7 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.ObjectNameUtil;
 import org.apache.geronimo.kernel.config.ConfigurationAlreadyExistsException;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationInfo;
@@ -44,7 +45,6 @@
 import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
 import org.apache.geronimo.kernel.config.IOUtil;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.FileWriteMonitor;
 import org.apache.geronimo.kernel.repository.WritableListableRepository;
@@ -68,7 +68,7 @@
 
     public RepositoryConfigurationStore(Kernel kernel, String objectName, WritableListableRepository repository) {
         this.kernel = kernel;
-        this.objectName = objectName == null ? null : JMXUtil.getObjectName(objectName);
+        this.objectName = objectName == null ? null : ObjectNameUtil.getObjectName(objectName);
         this.repository = repository;
         
         inPlaceConfUtil = new InPlaceConfigurationUtil();

Added: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXProxyManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXProxyManager.java?rev=395155&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXProxyManager.java (added)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXProxyManager.java Tue Apr 18 23:44:24 2006
@@ -0,0 +1,48 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.system.jmx;
+
+import net.sf.cglib.proxy.Callback;
+import net.sf.cglib.proxy.MethodInterceptor;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.basic.BasicProxyManager;
+import org.apache.geronimo.gbean.AbstractName;
+
+/**
+ * Pretty much the same as the BasicProxyManager, but it has a different way
+ * of handling the actual invocations.
+ *
+ * @version $Rev: 383682 $ $Date$
+ */
+public class JMXProxyManager extends BasicProxyManager {
+    public JMXProxyManager(Kernel kernel) {
+        super(kernel);
+    }
+
+    protected Callback getMethodInterceptor(Class proxyType, Kernel kernel, AbstractName target) {
+        return new JMXProxyMethodInterceptor(proxyType, kernel, target);
+    }
+
+    protected void doDestroy(MethodInterceptor methodInterceptor) {
+         ((JMXProxyMethodInterceptor)methodInterceptor).destroy();
+    }
+
+    protected AbstractName getAbstractName(MethodInterceptor methodInterceptor) {
+        return ((JMXProxyMethodInterceptor)methodInterceptor).getAbstractName();
+    }
+
+}

Propchange: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXProxyManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXProxyManager.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXProxyManager.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXProxyMethodInterceptor.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXProxyMethodInterceptor.java?rev=395155&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXProxyMethodInterceptor.java (added)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXProxyMethodInterceptor.java Tue Apr 18 23:44:24 2006
@@ -0,0 +1,284 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.system.jmx;
+
+import net.sf.cglib.asm.Type;
+import net.sf.cglib.core.Signature;
+import net.sf.cglib.proxy.MethodInterceptor;
+import net.sf.cglib.proxy.MethodProxy;
+import net.sf.cglib.reflect.FastClass;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.basic.KernelGetAttributeInvoker;
+import org.apache.geronimo.kernel.basic.KernelOperationInvoker;
+import org.apache.geronimo.kernel.basic.KernelSetAttributeInvoker;
+import org.apache.geronimo.kernel.basic.ProxyInvoker;
+import org.apache.geronimo.kernel.management.State;
+import org.apache.geronimo.kernel.proxy.DeadProxyException;
+import org.apache.geronimo.kernel.proxy.GeronimoManagedBean;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+
+/**
+ * @version $Rev: 385487 $ $Date$
+ */
+public class JMXProxyMethodInterceptor implements MethodInterceptor {
+    /**
+     * Type of the proxy interface
+     */
+    private final Class proxyType;
+
+    /**
+     * The object name to which we are connected.
+     */
+    private final AbstractName objectName;
+
+    /**
+     * GBeanInvokers keyed on the proxy interface method index
+     */
+    private ProxyInvoker[] gbeanInvokers;
+
+    public JMXProxyMethodInterceptor(Class proxyType, Kernel kernel, AbstractName targetName) {
+        assert proxyType != null;
+        assert kernel != null;
+        assert targetName != null;
+
+        this.proxyType = proxyType;
+        this.objectName = targetName;
+        gbeanInvokers = createGBeanInvokers(kernel);
+    }
+
+    public synchronized void destroy() {
+        gbeanInvokers = null;
+    }
+
+    public AbstractName getAbstractName() {
+        return objectName;
+    }
+
+    public final Object intercept(final Object object, final Method method, final Object[] args, final MethodProxy proxy) throws Throwable {
+        ProxyInvoker gbeanInvoker;
+
+        int interfaceIndex = proxy.getSuperIndex();
+        synchronized (this) {
+            if (gbeanInvokers == null) {
+                throw new DeadProxyException("Proxy is no longer valid");
+            }
+            gbeanInvoker = gbeanInvokers[interfaceIndex];
+        }
+
+        if (gbeanInvoker == null) {
+            throw new UnsupportedOperationException("No implementation method: objectName=" + objectName + ", method=" + method);
+        }
+
+        return gbeanInvoker.invoke(objectName, args);
+    }
+
+    private ProxyInvoker[] createGBeanInvokers(Kernel kernel) {
+        // build the method lookup table
+        FastClass fastClass = FastClass.create(proxyType);
+        ProxyInvoker[] invokers = new ProxyInvoker[fastClass.getMaxIndex() + 1];
+        Method[] methods = proxyType.getMethods();
+        for (int i = 0; i < methods.length; i++) {
+            Method method = methods[i];
+            int interfaceIndex = getSuperIndex(proxyType, method);
+            if (interfaceIndex >= 0) {
+                invokers[interfaceIndex] = createProxyInvoker(kernel, method);
+            }
+        }
+
+        // handle equals, hashCode and toString directly here
+        try {
+            invokers[getSuperIndex(proxyType, proxyType.getMethod("equals", new Class[]{Object.class}))] = new EqualsInvoke(kernel);
+            invokers[getSuperIndex(proxyType, proxyType.getMethod("hashCode", null))] = new HashCodeInvoke();
+            invokers[getSuperIndex(proxyType, proxyType.getMethod("toString", null))] = new ToStringInvoke(proxyType.getName());
+            if(GeronimoManagedBean.class.isAssignableFrom(proxyType)) {
+                invokers[getSuperIndex(proxyType, proxyType.getMethod("getState", null))] = new GetStateInvoke(kernel);
+                invokers[getSuperIndex(proxyType, proxyType.getMethod("getStateInstance", null))] = new GetStateInstanceInvoke(kernel);
+                invokers[getSuperIndex(proxyType, proxyType.getMethod("start", null))] = new StartInvoke(kernel);
+                invokers[getSuperIndex(proxyType, proxyType.getMethod("startRecursive", null))] = new StartRecursiveInvoke(kernel);
+                invokers[getSuperIndex(proxyType, proxyType.getMethod("stop", null))] = new StopInvoke(kernel);
+                invokers[getSuperIndex(proxyType, proxyType.getMethod("getStartTime", null))] = new GetStartTimeInvoke(kernel);
+                invokers[getSuperIndex(proxyType, proxyType.getMethod("getObjectName", null))] = new GetObjectNameInvoke();
+            }
+        } catch (Exception e) {
+            // this can not happen... all classes must implement equals, hashCode and toString
+            throw new AssertionError(e);
+        }
+
+        return invokers;
+    }
+
+    private ProxyInvoker createProxyInvoker(Kernel kernel, Method method) {
+        String methodName = method.getName();
+        if (!Modifier.isPublic(method.getModifiers()) || Modifier.isStatic(method.getModifiers())) {
+            return null;
+        }
+
+        // is this a getter is "is" method
+        if (method.getParameterTypes().length == 0 && method.getReturnType() != Void.TYPE) {
+            if (methodName.length() > 3 && methodName.startsWith("get") && !methodName.equals("getClass")) {
+                String propertyName = decapitalizePropertyName(methodName.substring(3));
+                return new KernelGetAttributeInvoker(kernel, propertyName);
+            } else if (methodName.length() > 2 && methodName.startsWith("is")) {
+                String propertyName = decapitalizePropertyName(methodName.substring(2));
+                return new KernelGetAttributeInvoker(kernel, propertyName);
+            }
+        }
+
+        // is this a setter method
+        if (method.getParameterTypes().length == 1 &&
+                method.getReturnType() == Void.TYPE &&
+                methodName.length() > 3 &&
+                methodName.startsWith("set")) {
+            String propertyName = decapitalizePropertyName(methodName.substring(3));
+            return new KernelSetAttributeInvoker(kernel, propertyName);
+        }
+
+        // it is just a plain old opertaion
+        return new KernelOperationInvoker(kernel, method);
+    }
+
+    private static int getSuperIndex(Class proxyType, Method method) {
+        Signature signature = new Signature(method.getName(), Type.getReturnType(method), Type.getArgumentTypes(method));
+        MethodProxy methodProxy = MethodProxy.find(proxyType, signature);
+        if (methodProxy != null) {
+            return methodProxy.getSuperIndex();
+        }
+        return -1;
+    }
+
+    private static String decapitalizePropertyName(String propertyName) {
+        if (Character.isUpperCase(propertyName.charAt(0))) {
+            return Character.toLowerCase(propertyName.charAt(0)) + propertyName.substring(1);
+        }
+        return propertyName;
+    }
+
+    static final class HashCodeInvoke implements ProxyInvoker {
+        public Object invoke(AbstractName abstractName, Object[] arguments) throws Throwable {
+            return new Integer(abstractName.hashCode());
+        }
+    }
+
+    static final class EqualsInvoke implements ProxyInvoker {
+        private final Kernel kernel;
+
+        public EqualsInvoke(Kernel kernel) {
+            this.kernel = kernel;
+        }
+
+        public Object invoke(AbstractName abstractName, Object[] arguments) throws Throwable {
+            AbstractName proxyTarget = kernel.getAbstractNameFor(arguments[0]);
+            return Boolean.valueOf(abstractName.equals(proxyTarget));
+        }
+    }
+
+    static final class ToStringInvoke implements ProxyInvoker {
+        private final String interfaceName;
+
+        public ToStringInvoke(String interfaceName) {
+            this.interfaceName = "[" + interfaceName + ": ";
+        }
+
+        public Object invoke(AbstractName abstractName, Object[] arguments) throws Throwable {
+            return interfaceName + abstractName + "]";
+        }
+    }
+
+    static final class GetStateInvoke implements ProxyInvoker {
+        private Kernel kernel;
+
+        public GetStateInvoke(Kernel kernel) {
+            this.kernel = kernel;
+        }
+
+        public Object invoke(AbstractName abstractName, Object[] arguments) throws Throwable {
+            return new Integer(kernel.getGBeanState(abstractName));
+        }
+    }
+
+    static final class GetStateInstanceInvoke implements ProxyInvoker {
+        private Kernel kernel;
+
+        public GetStateInstanceInvoke(Kernel kernel) {
+            this.kernel = kernel;
+        }
+
+        public Object invoke(AbstractName abstractName, Object[] arguments) throws Throwable {
+            return State.fromInt(kernel.getGBeanState(abstractName));
+        }
+    }
+
+    static final class StartInvoke implements ProxyInvoker {
+        private Kernel kernel;
+
+        public StartInvoke(Kernel kernel) {
+            this.kernel = kernel;
+        }
+
+        public Object invoke(AbstractName abstractName, Object[] arguments) throws Throwable {
+            kernel.startGBean(abstractName);
+            return null;
+        }
+    }
+
+    static final class StartRecursiveInvoke implements ProxyInvoker {
+        private Kernel kernel;
+
+        public StartRecursiveInvoke(Kernel kernel) {
+            this.kernel = kernel;
+        }
+
+        public Object invoke(AbstractName abstractName, Object[] arguments) throws Throwable {
+            kernel.startRecursiveGBean(abstractName);
+            return null;
+        }
+    }
+
+    static final class GetStartTimeInvoke implements ProxyInvoker {
+        private Kernel kernel;
+
+        public GetStartTimeInvoke(Kernel kernel) {
+            this.kernel = kernel;
+        }
+
+        public Object invoke(AbstractName abstractName, Object[] arguments) throws Throwable {
+            return new Long(kernel.getGBeanStartTime(abstractName));
+        }
+    }
+
+    static final class StopInvoke implements ProxyInvoker {
+        private Kernel kernel;
+
+        public StopInvoke(Kernel kernel) {
+            this.kernel = kernel;
+        }
+
+        public Object invoke(AbstractName abstractName, Object[] arguments) throws Throwable {
+            kernel.stopGBean(abstractName);
+            return null;
+        }
+    }
+
+    static final class GetObjectNameInvoke implements ProxyInvoker {
+        public Object invoke(AbstractName abstractName, Object[] arguments) throws Throwable {
+            return abstractName.getObjectName().getCanonicalName();
+        }
+    }
+}

Propchange: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXProxyMethodInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXProxyMethodInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXProxyMethodInterceptor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXUtil.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXUtil.java?rev=395155&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXUtil.java (added)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXUtil.java Tue Apr 18 23:44:24 2006
@@ -0,0 +1,95 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.system.jmx;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import javax.management.MBeanAttributeInfo;
+import javax.management.MBeanConstructorInfo;
+import javax.management.MBeanInfo;
+import javax.management.MBeanNotificationInfo;
+import javax.management.MBeanOperationInfo;
+import javax.management.MBeanParameterInfo;
+
+import org.apache.geronimo.gbean.GAttributeInfo;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GOperationInfo;
+import org.apache.geronimo.kernel.management.NotificationType;
+
+
+/**
+ * Helper class for JMX Operations
+ *
+ * @version $Rev: 383682 $ $Date$
+ */
+public final class JMXUtil {
+    private JMXUtil() {
+    }
+
+    public static MBeanInfo toMBeanInfo(GBeanInfo gBeanInfo) {
+        String className = gBeanInfo.getClassName();
+        String description = "No description available";
+
+        // attributes
+        Set gbeanAttributes = gBeanInfo.getAttributes();
+        MBeanAttributeInfo[] attributes = new MBeanAttributeInfo[gbeanAttributes.size()];
+        int a = 0;
+        for (Iterator iterator = gbeanAttributes.iterator(); iterator.hasNext();) {
+            GAttributeInfo gAttributeInfo = (GAttributeInfo) iterator.next();
+            attributes[a] = new MBeanAttributeInfo(gAttributeInfo.getName(), gAttributeInfo.getType(), "no description available", gAttributeInfo.isReadable(), gAttributeInfo.isWritable(), isIs(gAttributeInfo));
+            a++;
+        }
+
+        //we don't expose managed constructors
+        MBeanConstructorInfo[] constructors = new MBeanConstructorInfo[0];
+
+        // operations
+        Set gbeanOperations = gBeanInfo.getOperations();
+        MBeanOperationInfo[] operations = new MBeanOperationInfo[gbeanOperations.size()];
+        int o = 0;
+        for (Iterator iterator = gbeanOperations.iterator(); iterator.hasNext();) {
+            GOperationInfo gOperationInfo = (GOperationInfo) iterator.next();
+            //list of class names
+            List gparameters = gOperationInfo.getParameterList();
+            MBeanParameterInfo[] parameters = new MBeanParameterInfo[gparameters.size()];
+            int p = 0;
+            for (Iterator piterator = gparameters.iterator(); piterator.hasNext();) {
+                String type = (String) piterator.next();
+                parameters[p] = new MBeanParameterInfo("parameter" + p, type, "no description available");
+                p++;
+            }
+            operations[o] = new MBeanOperationInfo(gOperationInfo.getName(), "no description available", parameters, "java.lang.Object", MBeanOperationInfo.UNKNOWN);
+            o++;
+        }
+
+        MBeanNotificationInfo[] notifications = new MBeanNotificationInfo[1];
+        notifications[0] = new MBeanNotificationInfo(NotificationType.TYPES, "javax.management.Notification", "J2EE Notifications");
+
+        MBeanInfo mbeanInfo = new MBeanInfo(className, description, attributes, constructors, operations, notifications);
+        return mbeanInfo;
+    }
+
+    private static boolean isIs(GAttributeInfo gAttributeInfo) {
+        String getterName = gAttributeInfo.getGetterName();
+        if (getterName == null) {
+            return false;
+        }
+        return getterName.startsWith("is");
+    }
+}

Propchange: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXUtil.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/JMXUtil.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message