geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r109825 - in geronimo/branches/djencks/jetty-deployer1/trunk: modules/axis/src/java/org/apache/geronimo/axis modules/axis/src/test/org/apache/geronimo/axis/testUtils modules/deployment/src/java/org/apache/geronimo/deployment modules/kernel/src/java/org/apache/geronimo/gbean/jmx modules/kernel/src/java/org/apache/geronimo/gbean/runtime modules/kernel/src/java/org/apache/geronimo/kernel modules/kernel/src/java/org/apache/geronimo/kernel/config modules/kernel/src/test/org/apache/geronimo/gbean/runtime modules/kernel/src/test/org/apache/geronimo/kernel modules/kernel/src/test/org/apache/geronimo/kernel/config modules/system/src/java/org/apache/geronimo/system/configuration modules/system/src/test/org/apache/geronimo/system/configuration plugins/maven-geronimo-plugin/src/java/org/apache/geronimo/deployment/mavenplugin
Date Sat, 04 Dec 2004 20:59:02 GMT
Author: djencks
Date: Sat Dec  4 12:59:00 2004
New Revision: 109825

URL: http://svn.apache.org/viewcvs?view=rev&rev=109825
Log:
merge trunk changes to rev 109772, second try
Added:
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/LifecycleBroadcaster.java
      - copied unchanged from r109772, geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/LifecycleBroadcaster.java
Modified:
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGeronimoUtils.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/GBeanMBean.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/JMXLifecycleBroadcaster.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/LifecycleMonitor.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationStore.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Run.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/ConfigTest.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/config/RunTest.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalConfigStore.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/system/src/test/org/apache/geronimo/system/configuration/LocalConfigStoreTest.java
   geronimo/branches/djencks/jetty-deployer1/trunk/plugins/maven-geronimo-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/StartServer.java

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGeronimoUtils.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGeronimoUtils.java?view=diff&rev=109825&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGeronimoUtils.java&r1=109824&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGeronimoUtils.java&r2=109825
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGeronimoUtils.java	(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGeronimoUtils.java	Sat Dec  4 12:59:00 2004
@@ -39,9 +39,8 @@
 import java.util.zip.ZipException;
 import java.util.zip.ZipFile;
 import javax.ejb.EJBHome;
-import javax.management.AttributeNotFoundException;
+import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
-import javax.management.ReflectionException;
 
 import org.apache.axis.AxisFault;
 import org.apache.axis.client.AdminClient;
@@ -147,6 +146,18 @@
         }
     }
 
+    public static void startGBean(GBeanData gbean, Kernel kernel, ClassLoader classLoader)
+            throws DeploymentException {
+        try {
+            ObjectName objectName = gbean.getName();
+            startedGbeans.add(objectName);
+            kernel.loadGBean(gbean, classLoader);
+            kernel.startGBean(objectName);
+        } catch (Exception e) {
+            throw new DeploymentException(e);
+        }
+    }
+
     /**
      * @param objectName
      * @param gbean
@@ -308,7 +319,7 @@
      * @return
      * @throws Exception
      */
-    public static URI saveConfiguration(GBeanMBean config, ConfigurationStore store)throws Exception{
+    public static URI saveConfiguration(GBeanData config, ConfigurationStore store)throws Exception{
         File sourceFile = null;
         try {
             sourceFile = File.createTempFile("test", ".car");
@@ -316,11 +327,10 @@
             JarOutputStream jos = new JarOutputStream(new BufferedOutputStream(new FileOutputStream(sourceFile)));
             jos.putNextEntry(new ZipEntry("META-INF/config.ser"));
             ObjectOutputStream oos = new ObjectOutputStream(jos);
-            config.getGBeanData().writeExternal(oos);
+            config.writeExternal(oos);
             oos.flush();
             jos.closeEntry();
             jos.close();
-            ArrayList list = new ArrayList(1);
             return store.install(source);
         } finally {
             if (sourceFile != null) {
@@ -329,8 +339,8 @@
         }
     }
     
-    public static void createConfiguration(URI id,byte[] state,File unpackedDir) throws AttributeNotFoundException, ReflectionException, IOException{
-        GBeanMBean config = new GBeanMBean(Configuration.GBEAN_INFO);
+    public static void createConfiguration(URI id,byte[] state,File unpackedDir) throws MalformedObjectNameException, IOException{
+        GBeanData config = new GBeanData(Configuration.getConfigurationObjectName(id), Configuration.GBEAN_INFO);
         config.setAttribute("ID", id);
         config.setReferencePatterns("Parent", null);
         config.setAttribute("classPath", Collections.EMPTY_LIST);
@@ -343,7 +353,7 @@
             confSer.createNewFile();
             OutputStream fos = new FileOutputStream(confSer);
             ObjectOutputStream oos = new ObjectOutputStream(fos);
-            config.getGBeanData().writeExternal(oos);
+            config.writeExternal(oos);
             oos.flush();
             fos.close();
         } finally {
@@ -382,7 +392,7 @@
     public static URI saveAsConfiguration(byte[] state,URI id, ConfigurationStore store) throws Exception{
         //create a configuraton with Web Service GBean
         
-        GBeanMBean config = new GBeanMBean(Configuration.GBEAN_INFO);
+        GBeanData config = new GBeanData(Configuration.getConfigurationObjectName(id), Configuration.GBEAN_INFO);
         config.setAttribute("ID", id);
         config.setReferencePatterns("Parent", null);
         config.setAttribute("classPath", Collections.EMPTY_LIST);

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java?view=diff&rev=109825&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java&r1=109824&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java&r2=109825
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java	(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java	Sat Dec  4 12:59:00 2004
@@ -21,20 +21,17 @@
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.jar.JarFile;
 import java.util.zip.ZipFile;
-
 import javax.management.ObjectName;
 
 import org.apache.geronimo.deployment.ConfigurationBuilder;
 import org.apache.geronimo.deployment.DeploymentException;
+import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.WaitingException;
-import org.apache.geronimo.gbean.jmx.GBeanMBean;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 
@@ -91,15 +88,13 @@
             }
             
             if(wsplan.isEJBbased()){
-                GBeanMBean wsGbean = new GBeanMBean(EJBWSGBean.getGBeanInfo());
+                GBeanData wsGbean = new GBeanData(wsplan.getWsName(), EJBWSGBean.getGBeanInfo());
                 ArrayList classList = AxisGeronimoUtils.getClassFileList(new ZipFile(wsplan.getModule()));
                 wsGbean.setAttribute("classList", classList);
                 wsGbean.setReferencePattern("EjbConfig", wsplan.getEjbConfName());
-                Map gbeans = new HashMap();
-                gbeans.put(wsplan.getWsName(), wsGbean);
-//      
-//                //create a configuraton with Web Service GBean
-                byte[] state = Configuration.storeGBeans(gbeans);
+
+                //create a configuraton with Web Service GBean
+                byte[] state = Configuration.storeGBeans(new GBeanData[] {wsGbean});
                 AxisGeronimoUtils.createConfiguration(wsplan.getConfigURI(),state,unpackedDir);
 
             }else{
@@ -108,15 +103,13 @@
                 copyTheFile(rawmodule, installedModule);
                 
                 
-                GBeanMBean gbean = new GBeanMBean(POJOWSGBean.getGBeanInfo());
+                GBeanData gbean = new GBeanData(wsplan.getWsName(), POJOWSGBean.getGBeanInfo());
                 //TODO fill up the POJOWSGBean info
                 ArrayList classList = AxisGeronimoUtils.getClassFileList(new ZipFile(installedModule));
                 gbean.setAttribute("classList", classList);
                 gbean.setAttribute("moduleURL", installedModule.toURL());
             
-                Map gbeans = new HashMap();
-                gbeans.put(wsplan.getWsName(), gbean);
-                byte[] state = Configuration.storeGBeans(gbeans);
+                byte[] state = Configuration.storeGBeans(new GBeanData[] {gbean});
                 AxisGeronimoUtils.createConfiguration(wsplan.getConfigURI(),state,unpackedDir);
             }
         } catch (IOException e) {

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java?view=diff&rev=109825&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java&r1=109824&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java&r2=109825
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java	(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java	Sat Dec  4 12:59:00 2004
@@ -27,12 +27,12 @@
 
 import org.apache.geronimo.axis.AxisGeronimoUtils;
 import org.apache.geronimo.axis.WSPlan;
-import org.apache.geronimo.deployment.DeploymentException;
 import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.gbean.jmx.GBeanMBean;
+import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.j2ee.deployment.EARConfigBuilder;
 import org.apache.geronimo.j2ee.deployment.ResourceReferenceBuilder;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.transaction.OnlineUserTransaction;
@@ -41,18 +41,18 @@
  * @version $Rev: $ $Date: $
  */
 public class TestingUtils {
-    
-    protected static J2EEManager j2eeManager  = new J2EEManager();
-    
 
-    public static void startJ2EEContinerAndAxisServlet(Kernel kernel) throws Exception{
-//        //This does the work need to be done by plan
+    protected static J2EEManager j2eeManager = new J2EEManager();
+
+
+    public static void startJ2EEContinerAndAxisServlet(Kernel kernel) throws Exception {
+        //This does the work need to be done by plan
         j2eeManager.startJ2EEContainer(kernel);
         //start the Axis Serverlet which would be started by the service plan
-        org.apache.geronimo.jetty.JettyWebAppContext c = null;
-        GBeanMBean app = new GBeanMBean("org.apache.geronimo.jetty.JettyWebAppContext");
-        URL url =
-                Thread.currentThread().getContextClassLoader().getResource("deployables/axis/");
+        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+        GBeanInfo gbeanInfo = GBeanInfo.getGBeanInfo("org.apache.geronimo.jetty.JettyWebAppContext", classLoader);
+        GBeanData app = new GBeanData(AxisGeronimoConstants.APPLICATION_NAME, gbeanInfo);
+        URL url = classLoader.getResource("deployables/axis/");
         System.out.print(url);
         app.setAttribute("uri", URI.create(url.toString()));
         app.setAttribute("contextPath", "/axis");
@@ -65,14 +65,14 @@
         app.setAttribute("configurationBaseUrl", Thread.currentThread().getContextClassLoader().getResource("deployables/"));
         app.setReferencePattern("TransactionContextManager", AxisGeronimoConstants.TRANSACTION_CONTEXT_MANAGER_NAME);
         app.setReferencePattern("TrackedConnectionAssociator", AxisGeronimoConstants.TRACKED_CONNECTION_ASSOCIATOR_NAME);
-        AxisGeronimoUtils.startGBean(AxisGeronimoConstants.APPLICATION_NAME, app, kernel);
+        AxisGeronimoUtils.startGBean(app, kernel, classLoader);
 
     }
-    
-    public static void stopJ2EEContinerAndAxisServlet(Kernel kernel) throws Exception{
+
+    public static void stopJ2EEContinerAndAxisServlet(Kernel kernel) throws Exception {
         j2eeManager.stopJ2EEContainer(kernel);
     }
-    
+
     public static ResourceReferenceBuilder RESOURCE_REFERANCE_BUILDER = new ResourceReferenceBuilder() {
 
         public Reference createResourceRef(String containerId, Class iface) {
@@ -91,79 +91,80 @@
             return AxisGeronimoConstants.ACTIVATION_SPEC_INFO;
         }
 
-        public GBeanData locateResourceAdapterGBeanData(ObjectName resourceAdapterModuleName) throws DeploymentException {
+        public GBeanData locateResourceAdapterGBeanData(ObjectName resourceAdapterModuleName) {
             return null;
         }
 
-        public GBeanData locateAdminObjectInfo(ObjectName resourceAdapterModuleName, String adminObjectInterfaceName) throws DeploymentException {
+        public GBeanData locateAdminObjectInfo(ObjectName resourceAdapterModuleName, String adminObjectInterfaceName) {
             return null;
         }
 
-        public GBeanData locateConnectionFactoryInfo(ObjectName resourceAdapterModuleName, String connectionFactoryInterfaceName) throws DeploymentException {
+        public GBeanData locateConnectionFactoryInfo(ObjectName resourceAdapterModuleName, String connectionFactoryInterfaceName) {
             return null;
         }
     };
-    
-    
+
+
     public static void buildConfiguration(File jarfile,
             ConfigurationStore store,
             EARConfigBuilder earConfigBuilder,
             Kernel kernel,
-            ObjectName wsConfgBuilderName)throws Exception{
-        URI ejbURI = null;
-        ObjectName wsconf = new ObjectName("geronimo.test:name=" + jarfile.getName()+",value=check");
+            ObjectName wsConfgBuilderName) throws Exception {
+
+        ObjectName wsconf = new ObjectName("geronimo.test:name=" + jarfile.getName() + ",value=check");
         URI wsURI = new URI("new");
 
         WSPlan plan = null;
-        
+
         Enumeration entires = new JarFile(jarfile).entries();
         while (entires.hasMoreElements()) {
             ZipEntry zipe = (ZipEntry) entires.nextElement();
             String name = zipe.getName();
             if (name.endsWith("/ejb-jar.xml")) {
-                ObjectName ejbConfName = TestingUtils.installAndStartEJB(jarfile,store,earConfigBuilder,kernel);
-                plan = WSPlan.createPlan(wsURI,wsconf,ejbConfName,jarfile);
+                ObjectName ejbConfName = TestingUtils.installAndStartEJB(jarfile, store, earConfigBuilder, kernel);
+                plan = WSPlan.createPlan(wsURI, wsconf, ejbConfName, jarfile);
                 break;
             }
         }
-        
-        if(plan == null){
-            plan = WSPlan.createPlan(wsURI,wsconf,jarfile);
+
+        if (plan == null) {
+            plan = WSPlan.createPlan(wsURI, wsconf, jarfile);
         }
         File wsinstallDir = store.createNewConfigurationDir();
-        
-        kernel.invoke(wsConfgBuilderName,"buildConfiguration",
-            new Object[]{plan, null, wsinstallDir},
-            new String[]{Object.class.getName(),
-                JarFile.class.getName(),
-                File.class.getName()});
+
+        kernel.invoke(wsConfgBuilderName, "buildConfiguration",
+                new Object[]{plan, null, wsinstallDir},
+                new String[]{Object.class.getName(),
+                             JarFile.class.getName(),
+                             File.class.getName()});
         //wsconfBuilder.buildConfiguration(plan, null, wsinstallDir);
         
         URI wsInstalledURI = store.install(wsinstallDir);
-        GBeanMBean config = store.getConfiguration(wsInstalledURI);
+        GBeanData config = store.getConfiguration(wsInstalledURI);
         ConfigurationManager configurationManager = kernel.getConfigurationManager();
-        ObjectName configName = configurationManager.load(config, null);
+        ObjectName configName = configurationManager.load(config, null, Configuration.class.getClassLoader());
         kernel.startRecursiveGBean(configName);
-    
+
     }
-    
+
     public static ObjectName installAndStartEJB(File jarfile,
             ConfigurationStore store,
             EARConfigBuilder earConfigBuilder,
-            Kernel kernel)throws Exception{
-            JarFile module = new JarFile(jarfile);
-            File unpackedDir = store.createNewConfigurationDir();
-            //Install the EJB
-            Object ejbplan = earConfigBuilder.getDeploymentPlan(null, module);
-            earConfigBuilder.buildConfiguration(ejbplan, module, unpackedDir);
-            URI ejbURI = store.install(unpackedDir);
+            Kernel kernel) throws Exception {
 
-        
-          GBeanMBean config = store.getConfiguration(ejbURI);
-          ConfigurationManager configurationManager = kernel.getConfigurationManager();
-          ObjectName configName = configurationManager.load(config, store.getBaseURL(ejbURI));
-          kernel.startRecursiveGBean(configName);
-          return configName;
+        JarFile module = new JarFile(jarfile);
+        File unpackedDir = store.createNewConfigurationDir();
+        //Install the EJB
+        Object ejbplan = earConfigBuilder.getDeploymentPlan(null, module);
+        earConfigBuilder.buildConfiguration(ejbplan, module, unpackedDir);
+        URI ejbURI = store.install(unpackedDir);
+
+
+        GBeanData config = store.getConfiguration(ejbURI);
+        ConfigurationManager configurationManager = kernel.getConfigurationManager();
+        ObjectName configName = configurationManager.load(config, store.getBaseURL(ejbURI), Configuration.class.getClassLoader());
+        kernel.startRecursiveGBean(configName);
+        return configName;
     }
 
 }

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java?view=diff&rev=109825&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java&r1=109824&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java&r2=109825
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java	(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java	Sat Dec  4 12:59:00 2004
@@ -448,7 +448,19 @@
         // persist all the GBeans in this Configuration
         // save the dependencies and classpath
         try {
-            config.setAttribute("gBeanState", Configuration.storeGBeans(gbeans));
+            GBeanData[] gbeanArray = new GBeanData[gbeans.size()];
+            Iterator iterator = gbeans.entrySet().iterator();
+            for (int i = 0; i < gbeanArray.length; i++) {
+                Map.Entry entry = (Map.Entry) iterator.next();
+                Object gbean = entry.getValue();
+                if (gbean instanceof GBeanMBean) {
+                    gbeanArray[i] = ((GBeanMBean) gbean).getGBeanData();
+                    gbeanArray[i].setName((ObjectName) entry.getKey());
+                } else {
+                    gbeanArray[i] = (GBeanData) gbean;
+                }
+            }
+            config.setAttribute("gBeanState", Configuration.storeGBeans(gbeanArray));
             config.setReferencePatterns("Repositories", Collections.singleton(new ObjectName("*:role=Repository,*")));
             config.setAttribute("dependencies", new ArrayList(dependencies));
             config.setAttribute("classPath", new ArrayList(classPath));

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/GBeanMBean.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/GBeanMBean.java?view=diff&rev=109825&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/GBeanMBean.java&r1=109824&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/GBeanMBean.java&r2=109825
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/GBeanMBean.java	(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/GBeanMBean.java	Sat Dec  4 12:59:00 2004
@@ -194,6 +194,10 @@
         return mbeanInfo;
     }
 
+    public ClassLoader getClassLoader() {
+        return classLoader;
+    }
+
     public synchronized ObjectName preRegister(MBeanServer server, ObjectName objectName) throws Exception {
         if (gbeanInstance == null) {
             this.objectName = objectName;
@@ -205,7 +209,7 @@
             }
 
             gbeanData.setName(objectName);
-            lifecycleBroadcaster = new JMXLifecycleBroadcaster();
+            lifecycleBroadcaster = new JMXLifecycleBroadcaster(objectName, kernel.getLifecycleMonitor().createLifecycleBroadcaster(objectName));
             gbeanInstance = new GBeanInstance(kernel, gbeanData, lifecycleBroadcaster, classLoader);
             mbeanInfo = GBeanJMXUtil.toMBeanInfo(gbeanInstance.getGBeanInfo());
         }

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/JMXLifecycleBroadcaster.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/JMXLifecycleBroadcaster.java?view=diff&rev=109825&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/JMXLifecycleBroadcaster.java&r1=109824&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/JMXLifecycleBroadcaster.java&r2=109825
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/JMXLifecycleBroadcaster.java	(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/JMXLifecycleBroadcaster.java	Sat Dec  4 12:59:00 2004
@@ -16,48 +16,62 @@
  */
 package org.apache.geronimo.gbean.jmx;
 
-import javax.management.ObjectName;
-import javax.management.NotificationBroadcasterSupport;
+import javax.management.ListenerNotFoundException;
 import javax.management.Notification;
-import javax.management.NotificationListener;
+import javax.management.NotificationBroadcasterSupport;
 import javax.management.NotificationFilter;
-import javax.management.ListenerNotFoundException;
+import javax.management.NotificationListener;
+import javax.management.ObjectName;
 
-import org.apache.geronimo.kernel.LifecycleListener;
+import org.apache.geronimo.gbean.runtime.LifecycleBroadcaster;
 import org.apache.geronimo.kernel.management.NotificationType;
 
 /**
  * @version $Rev$ $Date$
  */
-public class JMXLifecycleBroadcaster implements LifecycleListener {
+public class JMXLifecycleBroadcaster implements LifecycleBroadcaster {
     private final NotificationBroadcasterSupport notificationBroadcaster = new NotificationBroadcasterSupport();
+    private final ObjectName objectName;
+    private final LifecycleBroadcaster lifecycleBroadcaster;
     private long sequence;
 
-    public void loaded(ObjectName objectName) {
+    public JMXLifecycleBroadcaster(ObjectName objectName, LifecycleBroadcaster lifecycleBroadcaster) {
+        this.objectName = objectName;
+        this.lifecycleBroadcaster = lifecycleBroadcaster;
+    }
+
+    public void fireLoadedEvent() {
+        lifecycleBroadcaster.fireLoadedEvent();
         notificationBroadcaster.sendNotification(new Notification(NotificationType.OBJECT_CREATED, objectName, nextSequence()));
     }
 
-    public void starting(ObjectName objectName) {
+    public void fireStartingEvent() {
+        lifecycleBroadcaster.fireStartingEvent();
         notificationBroadcaster.sendNotification(new Notification(NotificationType.STATE_STARTING, objectName, nextSequence()));
     }
 
-    public void running(ObjectName objectName) {
+    public void fireRunningEvent() {
+        lifecycleBroadcaster.fireRunningEvent();
         notificationBroadcaster.sendNotification(new Notification(NotificationType.STATE_RUNNING, objectName, nextSequence()));
     }
 
-    public void stopping(ObjectName objectName) {
+    public void fireStoppingEvent() {
+        lifecycleBroadcaster.fireStoppingEvent();
         notificationBroadcaster.sendNotification(new Notification(NotificationType.STATE_STOPPING, objectName, nextSequence()));
     }
 
-    public void stopped(ObjectName objectName) {
+    public void fireStoppedEvent() {
+        lifecycleBroadcaster.fireStoppedEvent();
         notificationBroadcaster.sendNotification(new Notification(NotificationType.STATE_STOPPED, objectName, nextSequence()));
     }
 
-    public void failed(ObjectName objectName) {
+    public void fireFailedEvent() {
+        lifecycleBroadcaster.fireFailedEvent();
         notificationBroadcaster.sendNotification(new Notification(NotificationType.STATE_FAILED, objectName, nextSequence()));
     }
 
-    public void unloaded(ObjectName objectName) {
+    public void fireUnloadedEvent() {
+        lifecycleBroadcaster.fireUnloadedEvent();
         notificationBroadcaster.sendNotification(new Notification(NotificationType.OBJECT_DELETED, objectName, nextSequence()));
     }
 

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java?view=diff&rev=109825&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java&r1=109824&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java&r2=109825
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java	(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java	Sat Dec  4 12:59:00 2004
@@ -43,7 +43,6 @@
 import org.apache.geronimo.gbean.InvalidConfigurationException;
 import org.apache.geronimo.gbean.WaitingException;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.LifecycleListener;
 import org.apache.geronimo.kernel.NoSuchAttributeException;
 import org.apache.geronimo.kernel.NoSuchOperationException;
 import org.apache.geronimo.kernel.management.EventProvider;
@@ -99,7 +98,7 @@
     /**
      * The single listener to which we broadcast lifecycle change events.
      */
-    private final LifecycleListener lifecycleBroadcaster;
+    private final LifecycleBroadcaster lifecycleBroadcaster;
 
     /**
      * The lifecycle controller given to the instance
@@ -190,7 +189,7 @@
      * @throws org.apache.geronimo.gbean.InvalidConfigurationException if the gbeanInfo is inconsistent with the actual java classes, such as
      * mismatched attribute types or the intial data can not be set
      */
-    public GBeanInstance(Kernel kernel, GBeanData gbeanData, LifecycleListener lifecycleBroadcaster, ClassLoader classLoader) throws InvalidConfigurationException {
+    public GBeanInstance(Kernel kernel, GBeanData gbeanData, LifecycleBroadcaster lifecycleBroadcaster, ClassLoader classLoader) throws InvalidConfigurationException {
         this.kernel = kernel;
         this.objectName = gbeanData.getName();
         this.lifecycleBroadcaster = lifecycleBroadcaster;
@@ -297,7 +296,7 @@
         for (int i = 0; i < references.length; i++) {
             references[i].online(this.kernel);
         }
-        lifecycleBroadcaster.loaded(objectName);
+        lifecycleBroadcaster.fireLoadedEvent();
     }
 
     public void destroy() {
@@ -308,7 +307,7 @@
             destroyed = true;
         }
 
-        lifecycleBroadcaster.unloaded(objectName);
+        lifecycleBroadcaster.fireUnloadedEvent();
 
         // just to be sure, stop all the references again
         for (int i = 0; i < references.length; i++) {

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java?view=diff&rev=109825&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java&r1=109824&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java&r2=109825
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java	(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java	Sat Dec  4 12:59:00 2004
@@ -62,7 +62,7 @@
     /**
      * The broadcaster of lifecycle events
      */
-    private final LifecycleListener lifecycleBroadcaster;
+    private final LifecycleBroadcaster lifecycleBroadcaster;
 
     /**
      * The listener for the of the object blocking the start of this gbean.
@@ -74,7 +74,7 @@
     // objects check if each other are in one state or another (i.e., classic A calls B while B calls A)
     private volatile State state = State.STOPPED;
 
-    GBeanInstanceState(Kernel kernel, ObjectName objectName, GBeanLifecycle gbeanLifecycle, LifecycleListener lifecycleBroadcaster) {
+    GBeanInstanceState(Kernel kernel, ObjectName objectName, GBeanLifecycle gbeanLifecycle, LifecycleBroadcaster lifecycleBroadcaster) {
         this.kernel = kernel;
         this.dependencyManager = kernel.getDependencyManager();
         this.objectName = objectName;
@@ -110,7 +110,7 @@
 
         // only fire a notification if we are not already starting
         if (state != State.STARTING) {
-            lifecycleBroadcaster.starting(objectName);
+            lifecycleBroadcaster.fireStartingEvent();
         }
 
         attemptFullStart();
@@ -188,7 +188,7 @@
 
         // only fire a notification if we are not already stopping
         if (state != State.STOPPING) {
-            lifecycleBroadcaster.stopping(objectName);
+            lifecycleBroadcaster.fireStoppingEvent();
         }
 
         // Don't try to stop dependents from within a synchronized block... this should reduce deadlocks
@@ -231,7 +231,7 @@
             doSafeFail();
             setStateInstance(State.FAILED);
         }
-        lifecycleBroadcaster.failed(objectName);
+        lifecycleBroadcaster.fireFailedEvent();
     }
 
     /**
@@ -523,23 +523,23 @@
         assert !Thread.holdsLock(this): "This method cannot be called while holding a synchronized lock on this";
         switch (state.toInt()) {
             case State.STOPPED_INDEX:
-                lifecycleBroadcaster.stopped(objectName);
+                lifecycleBroadcaster.fireStoppedEvent();
                 break;
 
             case State.STARTING_INDEX:
-                lifecycleBroadcaster.starting(objectName);
+                lifecycleBroadcaster.fireStartingEvent();
                 break;
 
             case State.RUNNING_INDEX:
-                lifecycleBroadcaster.running(objectName);
+                lifecycleBroadcaster.fireRunningEvent();
                 break;
 
             case State.STOPPING_INDEX:
-                lifecycleBroadcaster.stopping(objectName);
+                lifecycleBroadcaster.fireStoppingEvent();
                 break;
 
             case State.FAILED_INDEX:
-                lifecycleBroadcaster.failed(objectName);
+                lifecycleBroadcaster.fireFailedEvent();
                 break;
         }
     }

Copied: geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/LifecycleBroadcaster.java (from r109772, geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/LifecycleBroadcaster.java)
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/LifecycleBroadcaster.java?view=diff&rev=109825&p1=geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/LifecycleBroadcaster.java&r1=109772&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/LifecycleBroadcaster.java&r2=109825
==============================================================================

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java?view=diff&rev=109825&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java&r1=109824&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java&r2=109825
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java	(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java	Sat Dec  4 12:59:00 2004
@@ -24,13 +24,14 @@
 import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.Iterator;
-import java.util.HashSet;
 import javax.management.Attribute;
+import javax.management.AttributeNotFoundException;
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
 import javax.management.JMException;
@@ -38,17 +39,15 @@
 import javax.management.MBeanServer;
 import javax.management.MBeanServerFactory;
 import javax.management.MalformedObjectNameException;
-import javax.management.NotificationBroadcasterSupport;
 import javax.management.ObjectName;
-import javax.management.AttributeNotFoundException;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.runtime.GBeanInstance;
 import org.apache.geronimo.gbean.jmx.GBeanMBean;
 import org.apache.geronimo.gbean.jmx.JMXLifecycleBroadcaster;
+import org.apache.geronimo.gbean.runtime.GBeanInstance;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationManagerImpl;
@@ -78,7 +77,7 @@
  *
  * @version $Rev$ $Date$
  */
-public class Kernel extends NotificationBroadcasterSupport implements KernelMBean {
+public class Kernel implements KernelMBean {
 
     /**
      * The JMX name used by a Kernel to register itself when it boots.
@@ -411,13 +410,10 @@
      * @deprecated use loadGBean(GBeanData gbeanData, ClassLoader classLoader)
      */
     public void loadGBean(ObjectName name, GBeanMBean gbean) throws GBeanAlreadyExistsException, InternalKernelException {
-        try {
-            mbServer.registerMBean(gbean, name);
-        } catch (InstanceAlreadyExistsException e) {
-            throw new GBeanAlreadyExistsException(name.getCanonicalName());
-        } catch (Exception e) {
-            throw new InternalKernelException("Error loading GBean " + name.getCanonicalName(), unwrapJMException(e));
-        }
+        GBeanData gbeanData = gbean.getGBeanData();
+        gbeanData.setName(name);
+        ClassLoader classLoader = gbean.getClassLoader();
+        loadGBean(gbeanData, classLoader);
     }
 
     public void startGBean(ObjectName name) throws GBeanNotFoundException, InternalKernelException {
@@ -559,7 +555,7 @@
 
         mbServer = MBeanServerFactory.createMBeanServer(domainName);
         mbServer.registerMBean(this, KERNEL);
-        lifecycleMonitor = new LifecycleMonitor(mbServer);
+        lifecycleMonitor = new LifecycleMonitor(this);
         dependencyManager = new DependencyManager(lifecycleMonitor);
         proxyManager = new ProxyManager(this);
 
@@ -568,7 +564,7 @@
         configurationData.setReferencePatterns("Stores", Collections.singleton(CONFIGURATION_STORE_PATTERN));
 
         // create the connfiguration manager instance
-        JMXLifecycleBroadcaster lifecycleBroadcaster = new JMXLifecycleBroadcaster();
+        JMXLifecycleBroadcaster lifecycleBroadcaster = new JMXLifecycleBroadcaster(CONFIGURATION_MANAGER_NAME, lifecycleMonitor.createLifecycleBroadcaster(CONFIGURATION_MANAGER_NAME));
         configurationManagerInstance = new GBeanInstance(this, configurationData, lifecycleBroadcaster, getClass().getClassLoader());
         configurationManagerInstance.start();
         configurationManager = (ConfigurationManager) configurationManagerInstance.getTarget();

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/LifecycleMonitor.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/LifecycleMonitor.java?view=diff&rev=109825&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/LifecycleMonitor.java&r1=109824&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/LifecycleMonitor.java&r2=109825
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/LifecycleMonitor.java	(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/LifecycleMonitor.java	Sat Dec  4 12:59:00 2004
@@ -17,34 +17,25 @@
 
 package org.apache.geronimo.kernel;
 
+import java.util.Collections;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
-import java.util.Set;
 import java.util.Map;
-import java.util.Collections;
-import java.util.HashMap;
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerNotification;
-import javax.management.Notification;
-import javax.management.NotificationFilterSupport;
-import javax.management.NotificationListener;
+import java.util.Set;
 import javax.management.ObjectName;
-import javax.management.NotificationBroadcaster;
-import javax.management.NotificationFilter;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
-import org.apache.geronimo.kernel.management.NotificationType;
+import org.apache.geronimo.gbean.runtime.LifecycleBroadcaster;
 
 /**
  * @version $Rev: 71492 $ $Date: 2004-11-14 21:31:50 -0800 (Sun, 14 Nov 2004) $
  */
-public class LifecycleMonitor implements NotificationListener {
+public class LifecycleMonitor {
     private static final Log log = LogFactory.getLog(LifecycleMonitor.class);
 
-    private final MBeanServer server;
+    private final Kernel kernel;
 
     // todo we should only hold weak references to the listeners
     private final Map boundListeners = new HashMap();
@@ -53,58 +44,17 @@
     /**
      * @deprecated don't use this yet... it may change or go away
      */
-    public LifecycleMonitor(MBeanServer server) {
-        this.server = server;
-
-        // listen for all mbean registration events
-        try {
-            NotificationFilterSupport mbeanServerFilter = new NotificationFilterSupport();
-            mbeanServerFilter.enableType(MBeanServerNotification.REGISTRATION_NOTIFICATION);
-            mbeanServerFilter.enableType(MBeanServerNotification.UNREGISTRATION_NOTIFICATION);
-            server.addNotificationListener(JMXUtil.DELEGATE_NAME, this, mbeanServerFilter, null);
-        } catch (Exception e) {
-            // this will never happen... all of the above is well formed
-            throw new AssertionError(e);
-        }
+    public LifecycleMonitor(Kernel kernel) {
+        this.kernel = kernel;
 
         // register for state change notifications with all mbeans that match the target patterns
-        Set names = server.queryNames(null, null);
+        Set names = this.kernel.listGBeans((ObjectName)null);
         for (Iterator objectNameIterator = names.iterator(); objectNameIterator.hasNext();) {
             addSource((ObjectName) objectNameIterator.next());
         }
-
-        for (Iterator iterator = boundListeners.keySet().iterator(); iterator.hasNext();) {
-            ObjectName source = (ObjectName) iterator.next();
-            try {
-                if (server.isInstanceOf(source, NotificationBroadcaster.class.getName())) {
-                    server.addNotificationListener(source, this, STATE_CHANGE_FILTER, null);
-                }
-            } catch (InstanceNotFoundException e) {
-                // the instance died before we could get going... not a big deal
-                break;
-            } catch (Throwable e) {
-                log.warn("Could not add state change listener to: " + source + " on behalf of objectName", e);
-            }
-        }
     }
 
     public synchronized void destroy() {
-        try {
-            server.removeNotificationListener(JMXUtil.DELEGATE_NAME, this);
-        } catch (Exception ignore) {
-            // don't care... we tried
-        }
-
-        // unregister for all notifications
-        for (Iterator iterator = boundListeners.keySet().iterator(); iterator.hasNext();) {
-            ObjectName target = (ObjectName) iterator.next();
-            try {
-                server.removeNotificationListener(target, this, STATE_CHANGE_FILTER, null);
-            } catch (Exception ignore) {
-                // don't care... we tried
-            }
-        }
-
         boundListeners.clear();
         listenerPatterns.clear();
     }
@@ -257,61 +207,48 @@
         }
     }
 
-    public void handleNotification(Notification notification, Object o) {
-        String type = notification.getType();
+    /**
+     * @deprecated is this for internal use by the GBeanInstance and will be remove later
+     */
+    public LifecycleBroadcaster createLifecycleBroadcaster(ObjectName objectName) {
+        return new RawLifecycleBroadcaster(objectName);
+    }
 
-        if (MBeanServerNotification.REGISTRATION_NOTIFICATION.equals(type)) {
-            ObjectName source = ((MBeanServerNotification) notification).getMBeanName();
-            if (!boundListeners.containsKey(source)) {
-                // register for state change notifications
-                try {
-                    server.addNotificationListener(source, this, STATE_CHANGE_FILTER, null);
-                } catch (InstanceNotFoundException e) {
-                    // the instance died before we could get going... not a big deal
-                    return;
-                }
+    private class RawLifecycleBroadcaster implements LifecycleBroadcaster {
+        private final ObjectName objectName;
 
-                addSource(source);
-                fireLoadedEvent(source);
-            }
-        } else if (MBeanServerNotification.UNREGISTRATION_NOTIFICATION.equals(type)) {
-            ObjectName source = ((MBeanServerNotification) notification).getMBeanName();
-            fireUnloadedEvent(source);
-            removeSource(source);
-        } else {
-            final ObjectName source = (ObjectName) notification.getSource();
-            if (NotificationType.STATE_STARTING.equals(type)) {
-                fireStartingEvent(source);
-            } else if (NotificationType.STATE_RUNNING.equals(type)) {
-                fireRunningEvent(source);
-            } else if (NotificationType.STATE_STOPPING.equals(type)) {
-                fireStoppingEvent(source);
-            } else if (NotificationType.STATE_STOPPED.equals(type)) {
-                fireStoppedEvent(source);
-            } else if (NotificationType.STATE_FAILED.equals(type)) {
-                fireFailedEvent(source);
-            }
+        public RawLifecycleBroadcaster(ObjectName objectName) {
+            this.objectName = objectName;
         }
-    }
 
-    /**
-     * A notification filter which only lets all J2EE state change notifications pass.
-     * Specifically this is STATE_STARTING, STATE_RUNNING, STATE_STOPPING, STATE_STOPPED
-     * and STATE_FAILED.
-     */
-    private static final NotificationFilter STATE_CHANGE_FILTER = new J2EEStateChangeFilter();
+        public void fireLoadedEvent() {
+            addSource(objectName);
+            LifecycleMonitor.this.fireLoadedEvent(objectName);
+        }
+
+        public void fireStartingEvent() {
+            LifecycleMonitor.this.fireStartingEvent(objectName);
+        }
+
+        public void fireRunningEvent() {
+            LifecycleMonitor.this.fireRunningEvent(objectName);
+        }
+
+        public void fireStoppingEvent() {
+            LifecycleMonitor.this.fireStoppingEvent(objectName);
+        }
+
+        public void fireStoppedEvent() {
+            LifecycleMonitor.this.fireStoppedEvent(objectName);
+        }
 
-    private static final class J2EEStateChangeFilter implements NotificationFilter {
-        private J2EEStateChangeFilter() {
+        public void fireFailedEvent() {
+            LifecycleMonitor.this.fireFailedEvent(objectName);
         }
 
-        public boolean isNotificationEnabled(Notification notification) {
-            String type = notification.getType();
-            return NotificationType.STATE_STARTING.equals(type) ||
-                    NotificationType.STATE_RUNNING.equals(type) ||
-                    NotificationType.STATE_STOPPING.equals(type) ||
-                    NotificationType.STATE_STOPPED.equals(type) ||
-                    NotificationType.STATE_FAILED.equals(type);
+        public void fireUnloadedEvent() {
+            LifecycleMonitor.this.fireUnloadedEvent(objectName);
+            removeSource(objectName);
         }
     }
 }

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java?view=diff&rev=109825&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java&r1=109824&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java&r2=109825
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java	(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java	Sat Dec  4 12:59:00 2004
@@ -28,6 +28,7 @@
 import java.net.URI;
 import java.net.URL;
 import java.net.URLClassLoader;
+import java.net.MalformedURLException;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
@@ -47,7 +48,7 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
-import org.apache.geronimo.gbean.jmx.GBeanMBean;
+import org.apache.geronimo.gbean.WaitingException;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.kernel.repository.MissingDependencyException;
@@ -89,26 +90,55 @@
         return new ObjectName("geronimo.config:name=" + ObjectName.quote(configID.toString()));
     }
 
+    /**
+     * The kernel in which this configuration is registered
+     */
     private final Kernel kernel;
+
+    /**
+     * The registered objectName for this configuraion
+     */
     private final String objectNameString;
     private final ObjectName objectName;
+
+    /**
+     * URI used to referr to this configuration in the configuration manager
+     */
     private final URI id;
+
     /**
      * Identifies the type of configuration (WAR, RAR et cetera)
      */
     private final ConfigurationModuleType moduleType;
+
+    /**
+     * The uri of the parent of this configuration.  May be null.
+     */
     private final URI parentID;
-    private final ConfigurationParent parent;
-    private final List classPath;
-    private final List dependencies;
-    private byte[] gbeanState;
-    private final Collection repositories;
+
+    /**
+     * The configuration store from which this configuration was loaded.  May be null if this configuration
+     * was not loaded from a store.  The store is notified when the configurations stopps so it can update
+     * the saved state of the configration.
+     */
     private final ConfigurationStore configurationStore;
 
-    private URL baseURL;
-    private Set objectNames;
+    /**
+     * The names of all GBeans contained in this configuration.
+     */
+    private final Set objectNames;
+
+    /**
+     * The classloadeder used to load the child GBeans contained in this configuration.
+     */
+    private final ClassLoader configurationClassLoader;
 
-    private ClassLoader configurationClassLoader;
+    /**
+     * The GBeanData for the GBeans contained in this configuration.  These must be persisted as a ByteArray, becuase
+     * the data can only be deserialized in the configurationClassLoader, which is not available until this Configuration
+     * is deserialized and started.
+     */
+    private byte[] gbeanState;
 
     /**
      * Constructor that can be used to create an offline Configuration, typically
@@ -122,53 +152,31 @@
      * @param repositories a Collection<Repository> of repositories used to resolve dependencies
      * @param dependencies a List<URI> of dependencies
      */
-    public Configuration(Kernel kernel, String objectName, URI id, ConfigurationModuleType moduleType, URI parentID, ConfigurationParent parent, List classPath, byte[] gbeanState, Collection repositories, List dependencies, ConfigurationStore configurationStore) {
+    public Configuration(Kernel kernel,
+            String objectName,
+            URI id,
+            ConfigurationModuleType moduleType,
+            URL baseURL,
+            URI parentID,
+            ConfigurationParent parent,
+            List classPath,
+            byte[] gbeanState,
+            Collection repositories,
+            List dependencies,
+            ConfigurationStore configurationStore) throws Exception {
+
         this.kernel = kernel;
         this.objectNameString = objectName;
         this.objectName = JMXUtil.getObjectName(objectName);
         this.id = id;
         this.moduleType = moduleType;
         this.parentID = parentID;
-        this.parent = parent;
         this.gbeanState = gbeanState;
-        if (classPath == null) {
-            this.classPath = Collections.EMPTY_LIST;
-        } else {
-            this.classPath = classPath;
-        }
-        if (dependencies == null) {
-            this.dependencies = Collections.EMPTY_LIST;
-        } else {
-            this.dependencies = dependencies;
-        }
-        this.repositories = repositories;
+
         this.configurationStore = configurationStore;
-    }
 
-    public void doStart() throws Exception {
-        // build classpath
-        URL[] urls = new URL[dependencies.size() + classPath.size()];
-        int idx = 0;
-        for (Iterator i = dependencies.iterator(); i.hasNext();) {
-            URI uri = (URI) i.next();
-            URL url = null;
-            for (Iterator j = repositories.iterator(); j.hasNext();) {
-                Repository repository = (Repository) j.next();
-                if (repository.hasURI(uri)) {
-                    url = repository.getURL(uri);
-                    break;
-                }
-            }
-            if (url == null) {
-                throw new MissingDependencyException("Unable to resolve dependency " + uri);
-            }
-            urls[idx++] = url;
-        }
-        for (Iterator i = classPath.iterator(); i.hasNext();) {
-            URI uri = (URI) i.next();
-            urls[idx++] = new URL(baseURL, uri.toString());
-        }
-        assert idx == urls.length;
+        // build configurationClassLoader
+        URL[] urls = resolveClassPath(classPath, baseURL, dependencies, repositories);
         log.debug("ClassPath for " + id + " resolved to " + Arrays.asList(urls));
 
         if (parent == null) {
@@ -203,7 +211,7 @@
                 log.trace("Registering GBean " + name);
                 kernel.loadGBean(gbeanData, configurationClassLoader);
                 objectNames.add(name);
-                kernel.getDependencyManager().addDependency(name, objectName);
+                kernel.getDependencyManager().addDependency(name, this.objectName);
             }
             this.objectNames = objectNames;
         } finally {
@@ -213,6 +221,39 @@
         log.info("Started configuration " + id);
     }
 
+    private static URL[] resolveClassPath(List classPath, URL baseURL, List dependencies, Collection repositories) throws MalformedURLException, MissingDependencyException {
+        if (classPath == null) {
+            classPath = Collections.EMPTY_LIST;
+        }
+        if (dependencies == null) {
+            dependencies = Collections.EMPTY_LIST;
+        }
+
+        URL[] urls = new URL[dependencies.size() + classPath.size()];
+        int idx = 0;
+        for (Iterator i = dependencies.iterator(); i.hasNext();) {
+            URI uri = (URI) i.next();
+            URL url = null;
+            for (Iterator j = repositories.iterator(); j.hasNext();) {
+                Repository repository = (Repository) j.next();
+                if (repository.hasURI(uri)) {
+                    url = repository.getURL(uri);
+                    break;
+                }
+            }
+            if (url == null) {
+                throw new MissingDependencyException("Unable to resolve dependency " + uri);
+            }
+            urls[idx++] = url;
+        }
+        for (Iterator i = classPath.iterator(); i.hasNext();) {
+            URI uri = (URI) i.next();
+            urls[idx++] = new URL(baseURL, uri.toString());
+        }
+        assert idx == urls.length;
+        return urls;
+    }
+
     public String getObjectName() {
         return objectNameString;
     }
@@ -229,15 +270,27 @@
         }
     }
 
+    public void doStart() throws WaitingException, Exception {
+    }
+
     public void doStop() throws Exception {
         log.info("Stopping configuration " + id);
-        if (objectNames == null) {
-            return;
+
+        // get the gbean data for all gbeans
+        GBeanData[] gbeans = new GBeanData[objectNames.size()];
+        Iterator iterator = objectNames.iterator();
+        for (int i = 0; i < gbeans.length; i++) {
+            ObjectName objectName = (ObjectName) iterator.next();
+            try {
+                gbeans[i] = kernel.getGBeanData(objectName);
+            } catch (Exception e) {
+                throw new InvalidConfigException("Unable to serialize GBeanData for " + objectName, e);
+            }
         }
 
         // save state
         try {
-            gbeanState = storeGBeans(kernel, objectNames);
+            gbeanState = storeGBeans(gbeans);
         } catch (InvalidConfigException e) {
             log.info("Unable to update persistent state during shutdown", e);
         }
@@ -258,8 +311,6 @@
         if (configurationStore != null) {
             configurationStore.updateConfiguration(this);
         }
-
-        objectNames = null;
     }
 
     public void doFail() {
@@ -292,25 +343,7 @@
         return moduleType;
     }
 
-    /**
-     * Return the URL that is used to resolve relative classpath locations
-     *
-     * @return the base URL for the classpath
-     */
-    public URL getBaseURL() {
-        return baseURL;
-    }
-
-    /**
-     * Set the URL that should be used to resolve relative class locations
-     *
-     * @param baseURL the base URL for the classpath
-     */
-    public void setBaseURL(URL baseURL) {
-        this.baseURL = baseURL;
-    }
-
-    public byte[] getGbeanState() {
+    public byte[] getGBeanState() {
         return gbeanState;
     }
 
@@ -370,57 +403,11 @@
     /**
      * Return a byte array containing the persisted form of the supplied GBeans
      *
-     * @param gbeans a Map<ObjectName, GBeanMBean> of GBeans to store
-     * @return the persisted GBeans
-     * @throws org.apache.geronimo.kernel.config.InvalidConfigException
-     *          if there is a problem serializing the state
-     */
-    public static byte[] storeGBeans(Map gbeans) throws InvalidConfigException {
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        ObjectOutputStream oos;
-        try {
-            oos = new ObjectOutputStream(baos);
-        } catch (IOException e) {
-            throw (AssertionError) new AssertionError("Unable to initialize ObjectOutputStream").initCause(e);
-        }
-        for (Iterator i = gbeans.entrySet().iterator(); i.hasNext();) {
-            Map.Entry entry = (Map.Entry) i.next();
-            ObjectName objectName = (ObjectName) entry.getKey();
-
-            // value may be either a gbeanMBean or a gbeanData
-            GBeanData gbeanData;
-            if (entry.getValue() instanceof GBeanMBean) {
-                GBeanMBean gbeanMBean = (GBeanMBean) entry.getValue();
-                gbeanData = gbeanMBean.getGBeanData();
-            } else {
-                gbeanData = (GBeanData) entry.getValue();
-            }
-            try {
-                // todo we must explicitly set the bean name here from the gbean key because the gbean mbean may
-                // not have been brought online, so the object namve in the gbean mbean will be null
-                gbeanData.setName(objectName);
-                gbeanData.writeExternal(oos);
-            } catch (Exception e) {
-                throw new InvalidConfigException("Unable to serialize GBeanData for " + objectName, e);
-            }
-        }
-        try {
-            oos.flush();
-        } catch (IOException e) {
-            throw (AssertionError) new AssertionError("Unable to flush ObjectOutputStream").initCause(e);
-        }
-        return baos.toByteArray();
-    }
-
-    /**
-     * Return a byte array containing the persisted form of the supplied GBeans
-     *
-     * @param objectNames object names of gbeans to store
+     * @param gbeans the gbean data to persist
      * @return the persisted GBeans
-     * @throws org.apache.geronimo.kernel.config.InvalidConfigException
-     *          if there is a problem serializing the state
+     * @throws org.apache.geronimo.kernel.config.InvalidConfigException if there is a problem serializing the state
      */
-    private static byte[] storeGBeans(Kernel kernel, Set objectNames) throws InvalidConfigException {
+    public static byte[] storeGBeans(GBeanData[] gbeans) throws InvalidConfigException {
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream oos;
         try {
@@ -428,13 +415,12 @@
         } catch (IOException e) {
             throw (AssertionError) new AssertionError("Unable to initialize ObjectOutputStream").initCause(e);
         }
-        for (Iterator i = objectNames.iterator(); i.hasNext();) {
-            ObjectName objectName = (ObjectName) i.next();
+        for (int i = 0; i < gbeans.length; i++) {
+            GBeanData gbeanData = gbeans[i];
             try {
-                GBeanData gbeanData = kernel.getGBeanData(objectName);
                 gbeanData.writeExternal(oos);
             } catch (Exception e) {
-                throw new InvalidConfigException("Unable to serialize GBeanData for " + objectName, e);
+                throw new InvalidConfigException("Unable to serialize GBeanData for " + gbeanData.getName(), e);
             }
         }
         try {
@@ -469,6 +455,7 @@
             "objectName",
             "ID",
             "type",
+            "baseURL",
             "parentID",
             "Parent",
             "classPath",

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java?view=diff&rev=109825&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java&r1=109824&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java&r2=109825
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java	(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java	Sat Dec  4 12:59:00 2004
@@ -50,11 +50,6 @@
     ObjectName load(URI configID) throws NoSuchConfigException, IOException, InvalidConfigException;
 
     /**
-     * @deprecated use load(GBeanData config, URL rootURL, ClassLoader classLoader)
-     */
-    ObjectName load(GBeanMBean config, URL rootURL) throws InvalidConfigException;
-
-    /**
      * Load the supplied Configuration into the Kernel and override the default JMX name.
      * This method should be used with discretion as it is possible to create
      * Configurations that cannot be located by management or monitoring tools.

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java?view=diff&rev=109825&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java&r1=109824&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java&r2=109825
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java	(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java	Sat Dec  4 12:59:00 2004
@@ -35,7 +35,6 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
-import org.apache.geronimo.gbean.jmx.GBeanMBean;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.InternalKernelException;
 import org.apache.geronimo.kernel.Kernel;
@@ -94,7 +93,7 @@
                     }
                     ConfigurationModuleType type = null;
                     try {
-                        GBeanMBean bean = store.getConfiguration(configID);
+                        GBeanData bean = store.getConfiguration(configID);
                         type = (ConfigurationModuleType) bean.getAttribute("type");
                     } catch (Exception e) {
                         log.error(store + " defines configID " + configID + " which can not be loaded.");
@@ -122,51 +121,12 @@
         for (int i = 0; i < storeSnapshot.size(); i++) {
             ConfigurationStore store = (ConfigurationStore) storeSnapshot.get(i);
             if (store.containsConfiguration(configID)) {
-                GBeanMBean config = store.getConfiguration(configID);
+                GBeanData config = store.getConfiguration(configID);
                 URL baseURL = store.getBaseURL(configID);
-                return load(config, baseURL);
+                return load(config, baseURL, Configuration.class.getClassLoader());
             }
         }
         throw new NoSuchConfigException("No configuration with id: " + configID);
-    }
-
-    /**
-     * @deprecated use load(GBeanData config, URL rootURL, ClassLoader classLoader)
-     */
-    public ObjectName load(GBeanMBean config, URL rootURL) throws InvalidConfigException {
-        URI configID;
-        try {
-            configID = (URI) config.getAttribute("ID");
-        } catch (Exception e) {
-            throw new InvalidConfigException("Cannot get config ID", e);
-        }
-
-        ObjectName configName;
-        try {
-            configName = Configuration.getConfigurationObjectName(configID);
-        } catch (MalformedObjectNameException e) {
-            throw new InvalidConfigException("Cannot convert ID to ObjectName: ", e);
-        }
-
-        try {
-            kernel.loadGBean(configName, config);
-        } catch (Exception e) {
-            throw new InvalidConfigException("Unable to register configuration", e);
-        }
-
-        try {
-            config.setAttribute("baseURL", rootURL);
-        } catch (Exception e) {
-            try {
-                kernel.unloadGBean(configName);
-            } catch (Exception ignored) {
-                // ignore
-            }
-            throw new InvalidConfigException("Cannot set baseURL", e);
-        }
-        log.info("Loaded Configuration " + configName);
-
-        return configName;
     }
 
     public ObjectName load(GBeanData config, URL rootURL, ClassLoader classLoader) throws InvalidConfigException {

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationStore.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationStore.java?view=diff&rev=109825&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationStore.java&r1=109824&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationStore.java&r2=109825
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationStore.java	(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationStore.java	Sat Dec  4 12:59:00 2004
@@ -17,13 +17,13 @@
 
 package org.apache.geronimo.kernel.config;
 
-import java.io.IOException;
 import java.io.File;
+import java.io.IOException;
 import java.net.URI;
 import java.net.URL;
 import java.util.List;
 
-import org.apache.geronimo.gbean.jmx.GBeanMBean;
+import org.apache.geronimo.gbean.GBeanData;
 
 /**
  * Interface to a store for Configurations.
@@ -63,12 +63,12 @@
      * Return the Configuration GBean for the specified ID
      *
      * @param id the unique ID of a Configuration
-     * @return the GBeanMBean for that configuration
+     * @return the GBeanData for that configuration
      * @throws NoSuchConfigException if the store does not contain a Configuration with that id
      * @throws IOException if there was a problem loading the Configuration from the store
      * @throws InvalidConfigException if the Configuration is invalid
      */
-    GBeanMBean getConfiguration(URI id) throws NoSuchConfigException, IOException, InvalidConfigException;
+    GBeanData getConfiguration(URI id) throws NoSuchConfigException, IOException, InvalidConfigException;
 
     /**
      * Updates the saved state of the configuration.

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Run.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Run.java?view=diff&rev=109825&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Run.java&r1=109824&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Run.java&r2=109825
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Run.java	(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Run.java	Sat Dec  4 12:59:00 2004
@@ -23,7 +23,6 @@
 import java.util.jar.Manifest;
 import javax.management.ObjectName;
 
-import org.apache.geronimo.gbean.jmx.GBeanMBean;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.log.GeronimoLogging;
@@ -62,16 +61,15 @@
         try {
             kernel.boot();
 
-            GBeanMBean config;
+            GBeanData config = new GBeanData();
             ObjectInputStream ois = new ObjectInputStream(cl.getResourceAsStream("META-INF/config.ser"));
             try {
                 GBeanData gbeanData = new GBeanData();
                 gbeanData.readExternal(ois);
-                config = new GBeanMBean(gbeanData, cl);
             } finally {
                 ois.close();
             }
-            final ObjectName configName = kernel.getConfigurationManager().load(config, cl.getResource("/"));
+            final ObjectName configName = kernel.getConfigurationManager().load(config, cl.getResource("/"), cl);
 
             Runtime.getRuntime().addShutdownHook(new Thread("Shutdown Thread") {
                 public void run() {

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java?view=diff&rev=109825&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java&r1=109824&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java&r2=109825
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java	(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java	Sat Dec  4 12:59:00 2004
@@ -23,7 +23,6 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.InvalidConfigurationException;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.LifecycleAdapter;
 import org.apache.geronimo.kernel.MockDynamicGBean;
 import org.apache.geronimo.kernel.MockGBean;
 
@@ -351,11 +350,11 @@
 
         gbeanInstance = new GBeanInstance(kernel,
                 new GBeanData(new ObjectName("test:MockGBean=normal"), MockGBean.getGBeanInfo()),
-                new LifecycleAdapter(),
+                new MyLifecycleBroadcaster(),
                 MockGBean.class.getClassLoader());
         dynamicGBeanInstance = new GBeanInstance(kernel,
                 new GBeanData(new ObjectName("test:MockGBean=dynamic"), MockDynamicGBean.getGBeanInfo()),
-                new LifecycleAdapter(),
+                new MyLifecycleBroadcaster(),
                 MockGBean.class.getClassLoader());
         getInvoker = new MethodInvoker() {
 
@@ -376,5 +375,28 @@
     protected void tearDown() throws Exception {
         kernel.shutdown();
         gbeanInstance = null;
+    }
+
+    private static class MyLifecycleBroadcaster implements LifecycleBroadcaster {
+        public void fireLoadedEvent() {
+        }
+
+        public void fireStartingEvent() {
+        }
+
+        public void fireRunningEvent() {
+        }
+
+        public void fireStoppingEvent() {
+        }
+
+        public void fireStoppedEvent() {
+        }
+
+        public void fireFailedEvent() {
+        }
+
+        public void fireUnloadedEvent() {
+        }
     }
 }

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/ConfigTest.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/ConfigTest.java?view=diff&rev=109825&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/ConfigTest.java&r1=109824&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/ConfigTest.java&r2=109825
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/ConfigTest.java	(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/ConfigTest.java	Sat Dec  4 12:59:00 2004
@@ -19,8 +19,6 @@
 
 import java.net.URI;
 import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
 import javax.management.ObjectName;
 
 import junit.framework.TestCase;
@@ -39,8 +37,9 @@
     private ObjectName gbeanName2;
 
     public void testOnlineConfig() throws Exception {
-        GBeanData config = new GBeanData(Configuration.GBEAN_INFO);
-        config.setAttribute("ID", new URI("test"));
+        URI id = new URI("test");
+        GBeanData config = new GBeanData(Configuration.getConfigurationObjectName(id), Configuration.GBEAN_INFO);
+        config.setAttribute("ID", id);
         config.setReferencePatterns("Parent", null);
         config.setAttribute("classPath", Collections.EMPTY_LIST);
         config.setAttribute("gBeanState", state);
@@ -105,10 +104,7 @@
         mockBean2.setReferencePatterns("MockEndpoint", Collections.singleton(gbeanName1));
         mockBean2.setReferencePatterns("EndpointCollection", Collections.singleton(gbeanName1));
 
-        Map gbeans = new HashMap();
-        gbeans.put(gbeanName1, mockBean1);
-        gbeans.put(gbeanName2, mockBean2);
-        state = Configuration.storeGBeans(gbeans);
+        state = Configuration.storeGBeans(new GBeanData[] {mockBean1, mockBean2});
     }
 
     protected void tearDown() throws Exception {

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/config/RunTest.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/config/RunTest.java?view=diff&rev=109825&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/config/RunTest.java&r1=109824&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/config/RunTest.java&r2=109825
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/config/RunTest.java	(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/kernel/src/test/org/apache/geronimo/kernel/config/RunTest.java	Sat Dec  4 12:59:00 2004
@@ -23,8 +23,6 @@
 import java.io.ObjectOutputStream;
 import java.net.URI;
 import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
 import java.util.jar.Attributes;
 import java.util.jar.JarOutputStream;
 import java.util.jar.Manifest;
@@ -32,7 +30,7 @@
 import javax.management.ObjectName;
 
 import junit.framework.TestCase;
-import org.apache.geronimo.gbean.jmx.GBeanMBean;
+import org.apache.geronimo.gbean.GBeanData;
 
 /**
  * 
@@ -50,14 +48,15 @@
         super.setUp();
 
         try {
-            Map gbeans = new HashMap();
             ObjectName objectName = new ObjectName("test:name=MyGBean");
-            gbeans.put(objectName, new GBeanMBean(MyGBean.GBEAN_INFO));
-            GBeanMBean config = new GBeanMBean(Configuration.GBEAN_INFO);
-            config.setAttribute("ID", URI.create("org/apache/geronimo/run-test"));
+            GBeanData myGBeanData = new GBeanData(objectName, MyGBean.GBEAN_INFO);
+
+            URI id = URI.create("org/apache/geronimo/run-test");
+            GBeanData config = new GBeanData(Configuration.getConfigurationObjectName(id), Configuration.GBEAN_INFO);
+            config.setAttribute("ID", id);
             config.setReferencePatterns("Parent", null);
             config.setAttribute("classPath", Collections.EMPTY_LIST);
-            config.setAttribute("gBeanState", Configuration.storeGBeans(gbeans));
+            config.setAttribute("gBeanState", Configuration.storeGBeans(new GBeanData[] {myGBeanData}));
 
             carFile = File.createTempFile("run", ".car");
             Manifest manifest = new Manifest();
@@ -69,7 +68,7 @@
             JarOutputStream jos = new JarOutputStream(new FileOutputStream(carFile), manifest);
             jos.putNextEntry(new ZipEntry("META-INF/config.ser"));
             ObjectOutputStream oos = new ObjectOutputStream(jos);
-            config.getGBeanData().writeExternal(oos);
+            config.writeExternal(oos);
             oos.flush();
             jos.closeEntry();
             jos.putNextEntry(new ZipEntry("org/apache/geronimo/kernel/config/MyGBean.class"));

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalConfigStore.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalConfigStore.java?view=diff&rev=109825&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalConfigStore.java&r1=109824&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalConfigStore.java&r2=109825
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalConfigStore.java	(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalConfigStore.java	Sat Dec  4 12:59:00 2004
@@ -47,7 +47,6 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.gbean.WaitingException;
-import org.apache.geronimo.gbean.jmx.GBeanMBean;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
@@ -186,7 +185,7 @@
 
         URI configId;
         try {
-            GBeanMBean config = loadConfig(configurationDir);
+            GBeanData config = loadConfig(configurationDir);
             configId = (URI) config.getAttribute("ID");
             index.setProperty(configId.toString(), configurationDir.getName());
         } catch (Exception e) {
@@ -212,7 +211,7 @@
 
         URI configId;
         try {
-            GBeanMBean config = loadConfig(source);
+            GBeanData config = loadConfig(source);
             configId = (URI) config.getAttribute("ID");
             index.setProperty(configId.toString(), source.getName());
         } catch (Exception e) {
@@ -247,7 +246,7 @@
         delete(configDir);
     }
 
-    public synchronized GBeanMBean getConfiguration(URI configID) throws NoSuchConfigException, IOException, InvalidConfigException {
+    public synchronized GBeanData getConfiguration(URI configID) throws NoSuchConfigException, IOException, InvalidConfigException {
         return loadConfig(getRoot(configID));
     }
 
@@ -305,7 +304,7 @@
         return new File(rootDir, id);
     }
 
-    private GBeanMBean loadConfig(File configRoot) throws IOException, InvalidConfigException {
+    private GBeanData loadConfig(File configRoot) throws IOException, InvalidConfigException {
         File file = new File(configRoot, "META-INF/state.ser");
         if (!file.isFile()) {
             file = new File(configRoot, "META-INF/config.ser");
@@ -317,18 +316,15 @@
         FileInputStream fis = new FileInputStream(file);
         try {
             ObjectInputStream ois = new ObjectInputStream(new BufferedInputStream(fis));
-            GBeanMBean config;
+            GBeanData config = new GBeanData();
             try {
-                GBeanData gbeanData = new GBeanData();
-                gbeanData.readExternal(ois);
-                config = new GBeanMBean(gbeanData, Configuration.class.getClassLoader());
+                config.readExternal(ois);
             } catch (ClassNotFoundException e) {
                 //TODO more informative exceptions
                 throw new InvalidConfigException("Unable to read attribute ", e);
             } catch (Exception e) {
                 throw new InvalidConfigException("Unable to set attribute ", e);
             }
-
             config.setReferencePattern("ConfigurationStore", objectName);
             return config;
         } finally {

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/system/src/test/org/apache/geronimo/system/configuration/LocalConfigStoreTest.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/system/src/test/org/apache/geronimo/system/configuration/LocalConfigStoreTest.java?view=diff&rev=109825&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/system/src/test/org/apache/geronimo/system/configuration/LocalConfigStoreTest.java&r1=109824&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/system/src/test/org/apache/geronimo/system/configuration/LocalConfigStoreTest.java&r2=109825
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/system/src/test/org/apache/geronimo/system/configuration/LocalConfigStoreTest.java	(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/system/src/test/org/apache/geronimo/system/configuration/LocalConfigStoreTest.java	Sat Dec  4 12:59:00 2004
@@ -23,15 +23,12 @@
 import java.io.ObjectOutputStream;
 import java.net.URI;
 import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
 import java.util.jar.JarOutputStream;
 import java.util.zip.ZipEntry;
 import javax.management.ObjectName;
 
 import junit.framework.TestCase;
 import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.gbean.jmx.GBeanMBean;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
@@ -59,7 +56,7 @@
         assertEquals(new File(root, "1").toURL(),
             kernel.invoke(storeName, "getBaseURL", new Object[] {uri}, new String[] {"java.net.URI"}));
 
-        GBeanMBean config = (GBeanMBean) kernel.invoke(storeName, "getConfiguration", new Object[] {uri}, new String[] {"java.net.URI"});
+        GBeanData config = (GBeanData) kernel.invoke(storeName, "getConfiguration", new Object[] {uri}, new String[] {"java.net.URI"});
         assertEquals(uri, config.getAttribute("ID"));
     }
 
@@ -118,22 +115,19 @@
 
     protected void setUp() throws Exception {
         try {
-            kernel = new Kernel("test.kernel", "geronimo");
+            kernel = new Kernel("test.kernel");
             kernel.boot();
 
             gbeanName1 = new ObjectName("geronimo.test:name=MyMockGMBean1");
-            GBeanMBean mockBean1 = new GBeanMBean(MockGBean.getGBeanInfo());
+            GBeanData mockBean1 = new GBeanData(gbeanName1, MockGBean.getGBeanInfo());
             mockBean1.setAttribute("value", "1234");
 
             gbeanName2 = new ObjectName("geronimo.test:name=MyMockGMBean2");
-            GBeanMBean mockBean2 = new GBeanMBean(MockGBean.getGBeanInfo());
+            GBeanData mockBean2 = new GBeanData(gbeanName2, MockGBean.getGBeanInfo());
             mockBean2.setAttribute("gbeanEnabled", Boolean.FALSE);
             mockBean2.setAttribute("value", "1234");
 
-            Map gbeans = new HashMap();
-            gbeans.put(gbeanName1, mockBean1);
-            gbeans.put(gbeanName2, mockBean2);
-            state = Configuration.storeGBeans(gbeans);
+            state = Configuration.storeGBeans(new GBeanData[] {mockBean1, mockBean2});
 
             root = new File(System.getProperty("java.io.tmpdir") + "/config-store");
             recursiveDelete(root);
@@ -146,8 +140,8 @@
             kernel.loadGBean(store, getClass().getClassLoader());
             kernel.startGBean(storeName);
 
-            GBeanMBean gbean = new GBeanMBean(Configuration.GBEAN_INFO);
             uri = new URI("test");
+            GBeanData gbean = new GBeanData(Configuration.getConfigurationObjectName(uri), Configuration.GBEAN_INFO);
             gbean.setAttribute("ID", uri);
             gbean.setAttribute("gBeanState", state);
 
@@ -157,7 +151,7 @@
             JarOutputStream jos = new JarOutputStream(new BufferedOutputStream(new FileOutputStream(sourceFile)));
             jos.putNextEntry(new ZipEntry("META-INF/config.ser"));
             ObjectOutputStream oos = new ObjectOutputStream(jos);
-            gbean.getGBeanData().writeExternal(oos);
+            gbean.writeExternal(oos);
             oos.flush();
             jos.closeEntry();
             jos.close();

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/plugins/maven-geronimo-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/StartServer.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/plugins/maven-geronimo-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/StartServer.java?view=diff&rev=109825&p1=geronimo/branches/djencks/jetty-deployer1/trunk/plugins/maven-geronimo-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/StartServer.java&r1=109824&p2=geronimo/branches/djencks/jetty-deployer1/trunk/plugins/maven-geronimo-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/StartServer.java&r2=109825
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/plugins/maven-geronimo-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/StartServer.java	(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/plugins/maven-geronimo-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/StartServer.java	Sat Dec  4 12:59:00 2004
@@ -28,7 +28,6 @@
 import javax.management.ObjectName;
 
 import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.gbean.jmx.GBeanMBean;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.log.GeronimoLogging;
@@ -97,12 +96,10 @@
         URL systemURL = new File(root, "bin/server.jar").toURL();
 //        System.out.println("systemURL = " + systemURL);
         URL configURL = new URL("jar:" + systemURL.toString() + "!/META-INF/config.ser");
-        GBeanMBean configuration;
+        GBeanData configuration = new GBeanData();
         ObjectInputStream ois = new ObjectInputStream(configURL.openStream());
         try {
-            GBeanData gbeanData = new GBeanData();
-            gbeanData.readExternal(ois);
-            configuration = new GBeanMBean(gbeanData, this.getClass().getClassLoader());
+            configuration.readExternal(ois);
         } finally {
             ois.close();
         }
@@ -112,7 +109,7 @@
         kernel.boot();
 
         ConfigurationManager configurationManager = kernel.getConfigurationManager();
-        ObjectName configName = configurationManager.load(configuration, systemURL);
+        ObjectName configName = configurationManager.load(configuration, systemURL, this.getClass().getClassLoader());
         kernel.startRecursiveGBean(configName);
 
         // load the rest of the configuration listed on the command line

Mime
View raw message