geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r390312 [2/2] - in /geronimo/branches/1.1: modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ modules/deploy-tool/src/java/org/apache/geronimo/deployment/ modules/deployment/src/java/org/apache/geronimo/deployment/...
Date Fri, 31 Mar 2006 03:48:28 GMT
Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java?rev=390312&r1=390311&r2=390312&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java Thu Mar 30 19:48:25 2006
@@ -16,22 +16,6 @@
  */
 package org.apache.geronimo.kernel.config;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.gbean.InvalidConfigurationException;
-import org.apache.geronimo.kernel.Naming;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
-import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.repository.ArtifactResolver;
-import org.apache.geronimo.kernel.repository.Dependency;
-import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.kernel.repository.ImportType;
-import org.apache.geronimo.kernel.repository.MissingDependencyException;
-
-import javax.management.ObjectName;
-
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -43,6 +27,18 @@
 import java.util.List;
 import java.util.ListIterator;
 import java.util.Map;
+import javax.management.ObjectName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.gbean.InvalidConfigurationException;
+import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.ArtifactResolver;
+import org.apache.geronimo.kernel.repository.Dependency;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.repository.ImportType;
+import org.apache.geronimo.kernel.repository.MissingDependencyException;
 
 /**
  * @version $Rev$ $Date$
@@ -53,16 +49,13 @@
     protected final ArtifactResolver artifactResolver;
     protected final Map configurations = new LinkedHashMap();
     protected final Collection repositories;
-    private final Naming naming;
 
-    public SimpleConfigurationManager(Collection stores, ArtifactResolver artifactResolver, Naming naming, Collection repositories) {
-        if (naming == null) throw new NullPointerException("naming is null");
+    public SimpleConfigurationManager(Collection stores, ArtifactResolver artifactResolver, Collection repositories) {
         if (stores == null) stores = Collections.EMPTY_SET;
         if (repositories == null) repositories = Collections.EMPTY_SET;
 
         this.stores = stores;
         this.artifactResolver = artifactResolver;
-        this.naming = naming;
         this.repositories = repositories;
     }
 
@@ -91,7 +84,7 @@
         if (configurations.containsKey(artifact)) {
             return true;
         }
-        
+
         List storeSnapshot = getStores();
         for (int i = 0; i < storeSnapshot.size(); i++) {
             ConfigurationStore store = (ConfigurationStore) storeSnapshot.get(i);
@@ -107,10 +100,6 @@
         return configurationStatus.getConfiguration();
     }
 
-    protected Artifact getConfigurationId(Configuration configuration) {
-        return configuration.getEnvironment().getConfigId();
-    }
-
     public synchronized boolean isLoaded(Artifact configId) {
         return configurations.containsKey(configId);
     }
@@ -123,24 +112,15 @@
             return configurationStatus.getConfiguration();
         }
 
-        // load the GBeanData for the new configuration
-        GBeanData gbeanData = loadConfigurationGBeanData(configurationId);
+        // load the ConfigurationData for the new configuration
+        ConfigurationData configurationData = loadConfigurationGBeanData(configurationId);
 
         // load the configuration
-        return loadConfiguration(gbeanData);
-    }
-
-    public Configuration loadConfiguration(ConfigurationData configurationData) throws NoSuchConfigException, IOException, InvalidConfigException {
-        return loadConfiguration(configurationData, null);
+        return loadConfiguration(configurationData);
     }
 
-    public Configuration loadConfiguration(ConfigurationData configurationData, ConfigurationStore configurationStore) throws NoSuchConfigException, IOException, InvalidConfigException {
-        GBeanData gbeanData = ConfigurationUtil.toConfigurationGBeanData(configurationData, configurationStore, repositories, artifactResolver);
-        return loadConfiguration(gbeanData);
-    }
-
-    private synchronized Configuration loadConfiguration(GBeanData gbeanData) throws NoSuchConfigException, IOException, InvalidConfigException {
-        Artifact id = getConfigurationId(gbeanData);
+    public synchronized Configuration loadConfiguration(ConfigurationData configurationData) throws NoSuchConfigException, IOException, InvalidConfigException {
+        Artifact id = configurationData.getId();
         if (configurations.containsKey(id)) {
             // already loaded, so just update the load count
             ConfigurationStatus configurationStatus = (ConfigurationStatus) configurations.get(id);
@@ -150,7 +130,7 @@
 
         // load configurations from the new child to the parents
         LinkedHashMap unloadedConfigurations = new LinkedHashMap();
-        loadDepthFirst(gbeanData, unloadedConfigurations);
+        loadDepthFirst(configurationData, unloadedConfigurations);
 
         // load and start the unloaded configurations depth first
         Map loadedConfigurations = new LinkedHashMap(unloadedConfigurations.size());
@@ -158,8 +138,8 @@
             for (Iterator iterator = unloadedConfigurations.entrySet().iterator(); iterator.hasNext();) {
                 Map.Entry entry = (Map.Entry) iterator.next();
                 Artifact configurationId = (Artifact) entry.getKey();
-                GBeanData configurationData = (GBeanData) entry.getValue();
-                Configuration configuration = load(configurationData, loadedConfigurations);
+                UnloadedContiguration unloadedConfiguration = (UnloadedContiguration) entry.getValue();
+                Configuration configuration = load(unloadedConfiguration.getConfigurationData(), unloadedConfiguration.getResolvedParentIds(), loadedConfigurations);
                 loadedConfigurations.put(configurationId, configuration);
             }
         } catch (Exception e) {
@@ -177,7 +157,7 @@
         for (Iterator iterator = loadedConfigurations.values().iterator(); iterator.hasNext();) {
             Configuration configuration = (Configuration) iterator.next();
             ConfigurationStatus configurationStatus = createConfigurationStatus(configuration);
-            configurations.put(getConfigurationId(configuration), configurationStatus);
+            configurations.put(configuration.getId(), configurationStatus);
         }
 
         ConfigurationStatus configurationStatus = (ConfigurationStatus) configurations.get(id);
@@ -185,19 +165,12 @@
         return configurationStatus.getConfiguration();
     }
 
-    protected Configuration load(GBeanData configurationData, Map loadedConfigurations) throws InvalidConfigException {
-        Artifact configurationId = getConfigurationId(configurationData);
+    protected Configuration load(ConfigurationData configurationData, LinkedHashSet resolvedParentIds, Map loadedConfigurations) throws InvalidConfigException {
+        Artifact configurationId = configurationData.getId();
         try {
-            Environment environment = (Environment) configurationData.getAttribute("environment");
-
-            Collection parents = resolveParents(environment, loadedConfigurations);
-
-            ConfigurationModuleType moduleType = (ConfigurationModuleType) configurationData.getAttribute("moduleType");
-            List classPath = (List) configurationData.getAttribute("classPath");
-            byte[] gbeanState = (byte[]) configurationData.getAttribute("gBeanState");
-            ConfigurationResolver configurationResolver = (ConfigurationResolver) configurationData.getAttribute("configurationResolver");
+            Collection parents = findParentConfigurations(resolvedParentIds, loadedConfigurations);
 
-            Configuration configuration = new Configuration(parents, moduleType, environment, classPath, gbeanState, configurationResolver, naming);
+            Configuration configuration = new Configuration(parents, configurationData, new ConfigurationResolver(configurationData, repositories, artifactResolver));
             configuration.doStart();
             return configuration;
         } catch (Exception e) {
@@ -205,32 +178,22 @@
         }
     }
 
-    private Collection resolveParents(Environment environment, Map loadedConfigurations) throws MissingDependencyException, InvalidConfigException {
+    private Collection findParentConfigurations(LinkedHashSet resolvedParentIds, Map loadedConfigurations) throws InvalidConfigException {
         LinkedHashMap parents = new LinkedHashMap();
-        List dependencies = new ArrayList(environment.getDependencies());
-        for (ListIterator iterator = dependencies.listIterator(); iterator.hasNext();) {
-            Dependency dependency = (Dependency) iterator.next();
-            Artifact resolvedArtifact = artifactResolver.resolve(dependency.getArtifact());
+        for (Iterator iterator = resolvedParentIds.iterator(); iterator.hasNext();) {
+            Artifact resolvedArtifact = (Artifact) iterator.next();
 
             Configuration parent = null;
             if (loadedConfigurations.containsKey(resolvedArtifact)) {
                 parent = (Configuration) loadedConfigurations.get(resolvedArtifact);
             } else if (isConfiguration(resolvedArtifact)) {
                 parent = getConfiguration(resolvedArtifact);
-            } else if (dependency.getImportType() == ImportType.SERVICES) {
-                // Service depdendencies require that the depdencency be a configuration
-                throw new InvalidConfigException("Dependency does not have services: " + resolvedArtifact);
+            } else {
+                throw new InvalidConfigException("Cound not find parent configuration: " + resolvedArtifact);
             }
 
-            if (parent != null) {
-                parents.put(resolvedArtifact, parent);
-
-                // update the dependency list to contain the resolved artifact
-                dependency = new Dependency(resolvedArtifact, dependency.getImportType());
-                iterator.set(dependency);
-            }
+            parents.put(resolvedArtifact, parent);
         }
-        environment.setDependencies(dependencies);
         return parents.values();
     }
 
@@ -250,10 +213,9 @@
         List parentStatuses = new ArrayList(parents.size());
         for (Iterator iterator = parents.iterator(); iterator.hasNext();) {
             Configuration parent = (Configuration) iterator.next();
-            Artifact parentId = getConfigurationId(parent);
-            ConfigurationStatus parentStatus = (ConfigurationStatus) configurations.get(parentId);
+            ConfigurationStatus parentStatus = (ConfigurationStatus) configurations.get(parent.getId());
             if (parentStatus == null) {
-                throw new IllegalStateException("Parent status not found " + parentId);
+                throw new IllegalStateException("Parent status not found " + parent.getId());
             }
 
             parentStatuses.add(parentStatus);
@@ -261,31 +223,24 @@
         return parentStatuses;
     }
 
-    protected static Artifact getConfigurationId(GBeanData gbeanData) {
-        Environment environment = (Environment) gbeanData.getAttribute("environment");
-        return environment.getConfigId();
-    }
-
-    private synchronized void loadDepthFirst(GBeanData gbeanData, LinkedHashMap unloadedConfigurations) throws NoSuchConfigException, IOException, InvalidConfigException {
+    private synchronized void loadDepthFirst(ConfigurationData configurationData, LinkedHashMap unloadedConfigurations) throws NoSuchConfigException, IOException, InvalidConfigException {
         try {
             // if this parent hasn't already been processed, iterate into the parent
-            Artifact configurationId = getConfigurationId(gbeanData);
+            Artifact configurationId = configurationData.getId();
             if (!unloadedConfigurations.containsKey(configurationId)) {
-                preprocessConfiguration(gbeanData);
+                LinkedHashSet resolvedParentIds = resolveParentIds(configurationData);
 
-                Environment environment = (Environment) gbeanData.getAttribute("environment");
-                for (Iterator iterator = environment.getDependencies().iterator(); iterator.hasNext();) {
-                    Dependency dependency = (Dependency) iterator.next();
-                    Artifact parentId = dependency.getArtifact();
+                for (Iterator iterator = resolvedParentIds.iterator(); iterator.hasNext();) {
+                    Artifact parentId = (Artifact) iterator.next();
                     if (!configurations.containsKey(parentId) && isConfiguration(parentId)) {
-                        GBeanData parentGBeanData = loadConfigurationGBeanData(parentId);
-                        loadDepthFirst(parentGBeanData, unloadedConfigurations);
+                        ConfigurationData parentConfigurationData = loadConfigurationGBeanData(parentId);
+                        loadDepthFirst(parentConfigurationData, unloadedConfigurations);
                     }
                 }
-            }
 
-            // depth first - all unloaded parents have been added, now add this configuration
-            unloadedConfigurations.put(configurationId, gbeanData);
+                // depth first - all unloaded parents have been added, now add this configuration
+                unloadedConfigurations.put(configurationId, new UnloadedContiguration(configurationData, resolvedParentIds));
+            }
         } catch (NoSuchConfigException e) {
             throw e;
         } catch (IOException e) {
@@ -297,37 +252,29 @@
         }
     }
 
-    private GBeanData loadConfigurationGBeanData(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
+    private ConfigurationData loadConfigurationGBeanData(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
         List storeSnapshot = getStores();
 
         for (int i = 0; i < storeSnapshot.size(); i++) {
             ConfigurationStore store = (ConfigurationStore) storeSnapshot.get(i);
             if (store.containsConfiguration(configId)) {
-                GBeanData configurationGBean = store.loadConfiguration(configId);
-                AbstractName configurationName = Configuration.getConfigurationAbstractName(configId);
-                configurationGBean.setAbstractName(configurationName);
-
-                Environment environment = (Environment) configurationGBean.getAttribute("environment");
-                ConfigurationResolver configurationResolver = new ConfigurationResolver(environment.getConfigId(), store, repositories, artifactResolver);
-                configurationGBean.setAttribute("configurationResolver", configurationResolver);
-
-                return configurationGBean;
+                ConfigurationData configurationData = store.loadConfiguration(configId);
+                return configurationData;
             }
         }
         throw new NoSuchConfigException("No configuration with id: " + configId);
     }
 
-    private void preprocessConfiguration(GBeanData gbeanData) throws MissingDependencyException, InvalidConfigException {
-        Environment environment = (Environment) gbeanData.getAttribute("environment");
+    private LinkedHashSet resolveParentIds(ConfigurationData configurationData) throws MissingDependencyException, InvalidConfigException {
+        Environment environment = configurationData.getEnvironment();
 
-        LinkedHashSet parentNames = new LinkedHashSet();
+        LinkedHashSet parentIds = new LinkedHashSet();
         List dependencies = new ArrayList(environment.getDependencies());
         for (ListIterator iterator = dependencies.listIterator(); iterator.hasNext();) {
             Dependency dependency = (Dependency) iterator.next();
             Artifact resolvedArtifact = artifactResolver.resolve(dependency.getArtifact());
             if (isConfiguration(resolvedArtifact)) {
-                AbstractName parentName = Configuration.getConfigurationAbstractName(resolvedArtifact);
-                parentNames.add(parentName);
+                parentIds.add(resolvedArtifact);
 
                 // update the dependency list to contain the resolved artifact
                 dependency = new Dependency(resolvedArtifact, dependency.getImportType());
@@ -337,17 +284,35 @@
                 throw new InvalidConfigException("Dependency does not have services: " + resolvedArtifact);
             }
         }
-        environment.setDependencies(dependencies);
 
-        // add parents to the parents reference collection
-        gbeanData.addDependencies(parentNames);
-        gbeanData.setReferencePatterns("Parents", parentNames);
+//        // add parents to the parents reference collection
+//        configurationData.addDependencies(parentNames);
+//        configurationData.setReferencePatterns("Parents", parentNames);
+//
+//        configurationData.setAttribute("naming", naming);
+        return parentIds;
+    }
+
+    private static class UnloadedContiguration {
+        private final ConfigurationData configurationData;
+        private final LinkedHashSet resolvedParentIds;
+
+        public UnloadedContiguration(ConfigurationData configurationData, LinkedHashSet resolvedParentIds) {
+            this.configurationData = configurationData;
+            this.resolvedParentIds = resolvedParentIds;
+        }
+
+        public ConfigurationData getConfigurationData() {
+            return configurationData;
+        }
 
-        gbeanData.setAttribute("naming", naming);
+        public LinkedHashSet getResolvedParentIds() {
+            return resolvedParentIds;
+        }
     }
 
     public void startConfiguration(Configuration configuration) throws InvalidConfigException {
-        startConfiguration(getConfigurationId(configuration));
+        startConfiguration(configuration.getId());
     }
 
     public synchronized void startConfiguration(Artifact id) throws InvalidConfigException {
@@ -381,7 +346,7 @@
     }
 
     public void stopConfiguration(Configuration configuration) throws InvalidConfigException {
-        stopConfiguration(getConfigurationId(configuration));
+        stopConfiguration(configuration.getId());
     }
 
     public synchronized void stopConfiguration(Artifact id) throws InvalidConfigException {
@@ -402,7 +367,7 @@
     }
 
     public void unloadConfiguration(Configuration configuration) throws NoSuchConfigException {
-        unloadConfiguration(getConfigurationId(configuration));
+        unloadConfiguration(configuration.getId());
     }
 
     public synchronized void unloadConfiguration(Artifact id) throws NoSuchConfigException {
@@ -410,9 +375,8 @@
         List unloadList = configurationStatus.unload();
         for (Iterator iterator = unloadList.iterator(); iterator.hasNext();) {
             Configuration configuration = (Configuration) iterator.next();
-            Artifact configurationId = getConfigurationId(configuration);
             unload(configuration);
-            configurations.remove(configurationId);
+            configurations.remove(configuration.getId());
         }
     }
 
@@ -420,7 +384,7 @@
         try {
             configuration.doStop();
         } catch (Exception e) {
-            log.debug("Problem unloading config: " + getConfigurationId(configuration), e);
+            log.debug("Problem unloading config: " + configuration.getId(), e);
         }
     }
 
@@ -436,8 +400,9 @@
         private int startCount = 0;
 
         public ConfigurationStatus(Configuration configuration, List loadParents, List startParents) {
-            if (!loadParents.containsAll(startParents))
+            if (!loadParents.containsAll(startParents)) {
                 throw new IllegalArgumentException("loadParents must contain all startParents");
+            }
             this.configuration = configuration;
             this.loadParents = loadParents;
             this.startParents = startParents;

Modified: geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java?rev=390312&r1=390311&r2=390312&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java Thu Mar 30 19:48:25 2006
@@ -93,23 +93,23 @@
 
         Environment e1 = new Environment();
         e1.setConfigId(artifact1);
-        ConfigurationData configurationData1 = new ConfigurationData(ConfigurationModuleType.CAR, null, null, null, e1, new File("."), kernel.getNaming());
-        GBeanData gbeanData1 = ConfigurationUtil.toConfigurationGBeanData(configurationData1, configStore, Collections.singleton(testRepository), artifactResolver);
-        configurations.put(artifact1, gbeanData1);
+        ConfigurationData configurationData1 = new ConfigurationData(e1, kernel.getNaming());
+        configurationData1.setConfigurationStore(configStore);
+        configurations.put(artifact1, configurationData1);
 
         Environment e2 = new Environment();
         e2.setConfigId(artifact2);
         e2.addDependency(new Artifact("test", "1", (Version) null, "bar"), ImportType.ALL);
-        ConfigurationData configurationData2 = new ConfigurationData(ConfigurationModuleType.CAR, null, null, null, e2, new File("."), kernel.getNaming());
-        GBeanData gbeanData2 = ConfigurationUtil.toConfigurationGBeanData(configurationData2, configStore, Collections.singleton(testRepository), artifactResolver);
-        configurations.put(artifact2, gbeanData2);
+        ConfigurationData configurationData2 = new ConfigurationData(e2, kernel.getNaming());
+        configurationData2.setConfigurationStore(configStore);
+        configurations.put(artifact2, configurationData2);
 
         Environment e3 = new Environment();
         e3.setConfigId(artifact3);
         e3.addDependency(new Artifact("test", "2", (Version) null, "bar"), ImportType.ALL);
-        ConfigurationData configurationData3 = new ConfigurationData(ConfigurationModuleType.CAR, null, null, null, e3, new File("."), kernel.getNaming());
-        GBeanData gbeanData3 = ConfigurationUtil.toConfigurationGBeanData(configurationData3, configStore, Collections.singleton(testRepository), artifactResolver);
-        configurations.put(artifact3, gbeanData3);
+        ConfigurationData configurationData3 = new ConfigurationData(e3, kernel.getNaming());
+        configurationData3.setConfigurationStore(configStore);
+        configurations.put(artifact3, configurationData3);
 
 
         configurationManager = new KernelConfigurationManager(kernel,
@@ -131,8 +131,8 @@
             throw new UnsupportedOperationException();
         }
 
-        public GBeanData loadConfiguration(Artifact configId) throws IOException, InvalidConfigException, NoSuchConfigException {
-            return (GBeanData) configurations.get(configId);
+        public ConfigurationData loadConfiguration(Artifact configId) throws IOException, InvalidConfigException, NoSuchConfigException {
+            return (ConfigurationData) configurations.get(configId);
         }
 
         public boolean containsConfiguration(Artifact configId) {

Modified: geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/repository/ArtifactResolverTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/repository/ArtifactResolverTest.java?rev=390312&r1=390311&r2=390312&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/repository/ArtifactResolverTest.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/repository/ArtifactResolverTest.java Thu Mar 30 19:48:25 2006
@@ -16,34 +16,29 @@
  */
 package org.apache.geronimo.kernel.repository;
 
-import junit.framework.TestCase;
-import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.config.ConfigurationModuleType;
-import org.apache.geronimo.kernel.config.ConfigurationResolver;
-import org.apache.geronimo.kernel.config.ConfigurationStore;
-import org.apache.geronimo.kernel.config.NoSuchConfigException;
-import org.apache.geronimo.kernel.config.InvalidConfigException;
-import org.apache.geronimo.kernel.config.ConfigurationData;
-import org.apache.geronimo.kernel.Jsr77Naming;
-import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
-
 import java.io.File;
 import java.io.IOException;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectOutputStream;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.LinkedHashSet;
+import java.util.List;
 import java.util.Set;
 import java.util.SortedSet;
 import java.util.TreeSet;
-import java.util.List;
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.net.URI;
+
+import junit.framework.TestCase;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.kernel.Jsr77Naming;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.ConfigurationResolver;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.config.InvalidConfigException;
+import org.apache.geronimo.kernel.config.NoSuchConfigException;
 
 /**
  * @version $Rev$ $Date$
@@ -103,21 +98,20 @@
         ArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, mockRepository);
 
         // create parent which uses version1 explicitly
-        ConfigurationResolver configurationResolver = new ConfigurationResolver(loader,
-                new MockConfigStore(new File("foo").toURL()),
-                Collections.singleton(mockRepository),
-                artifactResolver);
-
         Environment environment = new Environment();
         environment.setConfigId(loader);
         environment.addDependency(version1, ImportType.CLASSES);
+
+        ConfigurationData parentConfigurationData = new ConfigurationData(environment, new Jsr77Naming());
+        parentConfigurationData.setConfigurationStore(new MockConfigStore(new File("foo").toURL()));
+
+        ConfigurationResolver configurationResolver = new ConfigurationResolver(parentConfigurationData,
+                Collections.singleton(mockRepository),
+                artifactResolver);
+
         Configuration parent = new Configuration(null,
-                ConfigurationModuleType.SERVICE,
-                environment,
-                null,
-                null,
-                configurationResolver,
-                new Jsr77Naming());
+                parentConfigurationData,
+                configurationResolver);
 
         LinkedHashSet parents = new LinkedHashSet();
         parents.add(parent);
@@ -170,15 +164,10 @@
         public void uninstall(Artifact configID) throws NoSuchConfigException, IOException {
         }
 
-        public GBeanData loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
-            AbstractName configurationName = Configuration.getConfigurationAbstractName(configId);
-            GBeanData configData = new GBeanData(configurationName, Configuration.GBEAN_INFO);
-            Environment environment = new Environment();
-            environment.setConfigId(configId);
-            configData.setAttribute("environment", environment);
-            configData.setAttribute("gBeanState", NO_OBJECTS_OS);
-            configData.setAttribute("configurationStore", this);
-            return configData;
+        public ConfigurationData loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
+            ConfigurationData configurationData = new ConfigurationData(configId, new Jsr77Naming());
+            configurationData.setConfigurationStore(this);
+            return configurationData;
         }
 
         public boolean containsConfiguration(Artifact configID) {
@@ -203,21 +192,10 @@
 
         public final static GBeanInfo GBEAN_INFO;
 
-        private static final byte[] NO_OBJECTS_OS;
-
         static {
             GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(MockConfigStore.class, "ConfigurationStore");
             infoBuilder.addInterface(ConfigurationStore.class);
             GBEAN_INFO = infoBuilder.getBeanInfo();
-
-            ByteArrayOutputStream baos = new ByteArrayOutputStream();
-            try {
-                ObjectOutputStream oos = new ObjectOutputStream(baos);
-                oos.flush();
-                NO_OBJECTS_OS = baos.toByteArray();
-            } catch (IOException e) {
-                throw new RuntimeException(e);
-            }
         }
     }
 }

Modified: geronimo/branches/1.1/modules/naming-builder/src/test/org/apache/geronimo/naming/deployment/MessageDestinationTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/naming-builder/src/test/org/apache/geronimo/naming/deployment/MessageDestinationTest.java?rev=390312&r1=390311&r2=390312&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/naming-builder/src/test/org/apache/geronimo/naming/deployment/MessageDestinationTest.java (original)
+++ geronimo/branches/1.1/modules/naming-builder/src/test/org/apache/geronimo/naming/deployment/MessageDestinationTest.java Thu Mar 30 19:48:25 2006
@@ -29,10 +29,9 @@
 import org.apache.geronimo.j2ee.deployment.ServiceReferenceBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationResolver;
+import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.Jsr77Naming;
 import org.apache.geronimo.naming.java.ComponentContextBuilder;
@@ -111,12 +110,8 @@
         super.setUp();
         Artifact id = new Artifact("test", "test", "", "car");
         configuration = new Configuration(Collections.EMPTY_LIST,
-                ConfigurationModuleType.RAR,
-                new Environment(id),
-                Collections.EMPTY_LIST,
-                new byte[]{},
-                new ConfigurationResolver(id, null),
-                naming);
+                new ConfigurationData(id, naming),
+                new ConfigurationResolver(id, null));
         baseName = naming.createRootName(configuration.getId(), "testRoot", NameFactory.RESOURCE_ADAPTER_MODULE);
     }
 

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationDump.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationDump.java?rev=390312&r1=390311&r2=390312&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationDump.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationDump.java Thu Mar 30 19:48:25 2006
@@ -26,6 +26,7 @@
 import org.apache.geronimo.kernel.config.ConfigurationInfo;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.log.GeronimoLogging;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.repository.Artifact;
@@ -290,9 +291,9 @@
             return;
         }
         if (!kernel.isLoaded(name)) {
-            GBeanData gbeanData = configurationStore.loadConfiguration(configId);
-            kernel.loadGBean(gbeanData, ConfigurationDump.class.getClassLoader());
-            kernel.startGBean(name);
+            ConfigurationData configurationData = configurationStore.loadConfiguration(configId);
+//            kernel.loadGBean(gbeanData, ConfigurationDump.class.getClassLoader());
+//            kernel.startGBean(name);
         }
         //put the earliest ancestors first, even if we have already started them.
         ancestors.remove(configId);

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java?rev=390312&r1=390311&r2=390312&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java Thu Mar 30 19:48:25 2006
@@ -33,16 +33,15 @@
 
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
-import org.apache.geronimo.kernel.config.InvalidConfigException;
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 383067 $ $Date$
  */
 public final class ExecutableConfigurationUtil {
     private ExecutableConfigurationUtil() {
     }
 
-    public static void createExecutableConfiguration(ConfigurationData configurationData, Manifest manifest, File destinationFile) throws IOException, InvalidConfigException {
+    public static void createExecutableConfiguration(ConfigurationData configurationData, Manifest manifest, File destinationFile) throws IOException {
         File configurationDir = configurationData.getConfigurationDir();
         JarOutputStream out = null;
         try {
@@ -86,17 +85,17 @@
         }
     }
 
-    public static void writeConfiguration(ConfigurationData configurationData, JarOutputStream out) throws IOException, InvalidConfigException {
+    public static void writeConfiguration(ConfigurationData configurationData, JarOutputStream out) throws IOException {
         // save the persisted form in the source directory
         out.putNextEntry(new ZipEntry("META-INF/config.ser"));
         try {
-            ConfigurationUtil.storeBootstrapConfiguration(configurationData, out);
+            ConfigurationUtil.writeConfigurationData(configurationData, out);
         } finally {
             out.closeEntry();
         }
     }
 
-    public static void writeConfiguration(ConfigurationData configurationData, File source) throws InvalidConfigException, IOException {
+    public static void writeConfiguration(ConfigurationData configurationData, File source) throws IOException {
         // save the persisted form in the source directory
         File metaInf = new File(source, "META-INF");
         metaInf.mkdirs();
@@ -104,7 +103,7 @@
 
         OutputStream out = new FileOutputStream(configSer);
         try {
-            ConfigurationUtil.storeBootstrapConfiguration(configurationData, out);
+            ConfigurationUtil.writeConfigurationData(configurationData, out);
         } finally {
             if (out != null) {
                 try {

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java?rev=390312&r1=390311&r2=390312&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java Thu Mar 30 19:48:25 2006
@@ -20,7 +20,6 @@
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.ObjectInputStream;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
@@ -32,24 +31,24 @@
 import java.util.zip.ZipEntry;
 import javax.management.ObjectName;
 
-import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.config.ConfigurationAlreadyExistsException;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationInfo;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
-import org.apache.geronimo.kernel.config.ConfigurationAlreadyExistsException;
+import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.repository.WritableListableRepository;
 import org.apache.geronimo.kernel.repository.FileWriteMonitor;
+import org.apache.geronimo.kernel.repository.WritableListableRepository;
 import org.apache.geronimo.system.repository.IOUtil;
 
 /**
@@ -78,14 +77,14 @@
         return objectName.toString();
     }
 
-    public GBeanData loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
+    public ConfigurationData loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
         File location = repository.getLocation(configId);
 
         if (!location.exists() && location.canRead()) {
             throw new NoSuchConfigException("Configuration not found: " + configId);
         }
 
-        GBeanData config = new GBeanData();
+        ConfigurationData configurationData;
         try {
             if (location.isDirectory()) {
                 File serFile = new File(location, "META-INF");
@@ -99,8 +98,7 @@
 
                 InputStream in = new FileInputStream(serFile);
                 try {
-                    ObjectInputStream ois = new ObjectInputStream(in);
-                    config.readExternal(ois);
+                    configurationData = ConfigurationUtil.readConfigurationData(in);
                 } finally {
                     IOUtil.close(in);
                 }
@@ -110,8 +108,7 @@
                 try {
                     ZipEntry entry = jarFile.getEntry("META-INF/config.ser");
                     in = jarFile.getInputStream(entry);
-                    ObjectInputStream ois = new ObjectInputStream(in);
-                    config.readExternal(ois);
+                    configurationData = ConfigurationUtil.readConfigurationData(in);
                 } finally {
                     IOUtil.close(in);
                     IOUtil.close(jarFile);
@@ -121,7 +118,13 @@
             throw new InvalidConfigException("Unable to load class from config: " + configId, e);
         }
 
-        return config;
+        configurationData.setConfigurationDir(location);
+        configurationData.setConfigurationStore(this);
+        if (kernel != null) {
+            configurationData.setNaming(kernel.getNaming());
+        }
+
+        return configurationData;
     }
 
 
@@ -242,8 +245,8 @@
                             state = State.STOPPED;
                         }
 
-                        GBeanData bean = loadConfiguration(configId);
-                        ConfigurationModuleType type = (ConfigurationModuleType) bean.getAttribute("type");
+                        ConfigurationData configurationData = loadConfiguration(configId);
+                        ConfigurationModuleType type = configurationData.getModuleType();
 
                         configs.add(new ConfigurationInfo(objectName, configId, state, type));
                     } catch (Exception e) {
@@ -331,7 +334,6 @@
 
     static {
         GBeanInfoBuilder builder = GBeanInfoBuilder.createStatic(RepositoryConfigurationStore.class, "ConfigurationStore");
-        builder.addInterface(ConfigurationStore.class);
         builder.addAttribute("kernel", Kernel.class, false);
         builder.addAttribute("objectName", String.class, false);
         builder.addReference("Repository", WritableListableRepository.class, "Repository");

Modified: geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java?rev=390312&r1=390311&r2=390312&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java (original)
+++ geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java Thu Mar 30 19:48:25 2006
@@ -16,10 +16,8 @@
  */
 package org.apache.geronimo.tomcat.deployment;
 
-import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.IOException;
-import java.io.ObjectOutputStream;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
@@ -32,7 +30,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-
 import javax.management.ObjectName;
 import javax.naming.Reference;
 import javax.xml.namespace.QName;
@@ -66,7 +63,6 @@
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
-import org.apache.geronimo.kernel.config.ConfigurationResolver;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.config.EditableKernelConfigurationManager;
@@ -79,9 +75,9 @@
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.repository.ImportType;
 import org.apache.geronimo.kernel.repository.Repository;
+import org.apache.geronimo.security.SecurityServiceImpl;
 import org.apache.geronimo.security.jacc.ApplicationPolicyConfigurationManager;
 import org.apache.geronimo.security.jacc.ComponentPermissions;
-import org.apache.geronimo.security.SecurityServiceImpl;
 import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 import org.apache.geronimo.tomcat.ConnectorGBean;
 import org.apache.geronimo.tomcat.EngineGBean;
@@ -95,7 +91,7 @@
  * @version $Rev:385232 $ $Date$
  */
 public class TomcatModuleBuilderTest extends TestCase {
-    private Naming naming = new Jsr77Naming();
+    private static Naming naming = new Jsr77Naming();
     private Artifact baseId = new Artifact("test", "base", "1", "car");
     private final AbstractName serverName = naming.createRootName(baseId, "Server", "J2EEServer");
 
@@ -386,28 +382,16 @@
             configs.remove(configID);
         }
 
-        public GBeanData loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
-            AbstractName configurationObjectName = Configuration.getConfigurationAbstractName(configId);
-            GBeanData configData = new GBeanData(configurationObjectName, Configuration.GBEAN_INFO);
+        public ConfigurationData loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
             if (configs.containsKey(configId)) {
                 ConfigurationData configurationData = (ConfigurationData) configs.get(configId);
-                configData.setAttribute("moduleType", configurationData.getModuleType());
-                Environment environment = configurationData.getEnvironment();
-                configData.setAttribute("environment", environment);
-                configData.setAttribute("gBeanState", Configuration.storeGBeans(configurationData.getGBeans()));
-                configData.setAttribute("classPath", configurationData.getClassPath());
-
-                ConfigurationResolver configurationResolver = new ConfigurationResolver(configurationData.getEnvironment().getConfigId(), this, Collections.EMPTY_SET, new DefaultArtifactResolver(null, Collections.EMPTY_SET));
-                configData.setAttribute("configurationResolver", configurationResolver);
-
+                configurationData.setConfigurationStore(this);
+                return configurationData;
             } else {
-                Environment environment = new Environment();
-                environment.setConfigId(configId);
-                configData.setAttribute("environment", environment);
-                configData.setAttribute("moduleType", ConfigurationModuleType.WAR);
-                configData.setAttribute("gBeanState", NO_OBJECTS_OS);
+                ConfigurationData configurationData = new ConfigurationData(configId, naming);
+                configurationData.setConfigurationStore(this);
+                return configurationData;
             }
-            return configData;
         }
 
         public boolean containsConfiguration(Artifact configID) {
@@ -432,21 +416,10 @@
 
         public final static GBeanInfo GBEAN_INFO;
 
-        private static final byte[] NO_OBJECTS_OS;
-
         static {
             GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(MockConfigStore.class, NameFactory.CONFIGURATION_STORE);
             infoBuilder.addInterface(ConfigurationStore.class);
             GBEAN_INFO = infoBuilder.getBeanInfo();
-
-            ByteArrayOutputStream baos = new ByteArrayOutputStream();
-            try {
-                ObjectOutputStream oos = new ObjectOutputStream(baos);
-                oos.flush();
-                NO_OBJECTS_OS = baos.toByteArray();
-            } catch (IOException e) {
-                throw new RuntimeException(e);
-            }
         }
     }
 }

Modified: geronimo/branches/1.1/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/BaseConfigInstaller.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/BaseConfigInstaller.java?rev=390312&r1=390311&r2=390312&view=diff
==============================================================================
--- geronimo/branches/1.1/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/BaseConfigInstaller.java (original)
+++ geronimo/branches/1.1/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/BaseConfigInstaller.java Thu Mar 30 19:48:25 2006
@@ -16,9 +16,9 @@
  */
 package org.apache.geronimo.plugin.assembly;
 
-import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
+import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.ArtifactManager;
 import org.apache.geronimo.kernel.repository.ArtifactResolver;
@@ -41,7 +41,7 @@
 import java.util.LinkedHashSet;
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 384686 $ $Date$
  */
 public class BaseConfigInstaller {
     public static final FileWriteMonitor LOG_COPY_START = new StartFileWriteMonitor();
@@ -161,8 +161,8 @@
 
             // Determine the dependencies of this configuration
             try {
-                GBeanData config = targetStore.loadConfiguration(configId);
-                Environment environment = (Environment) config.getAttribute("environment");
+                ConfigurationData configurationData = targetStore.loadConfiguration(configId);
+                Environment environment = configurationData.getEnvironment();
                 dependencies = new LinkedHashSet();
                 for (Iterator iterator = environment.getDependencies().iterator(); iterator.hasNext();) {
                     Dependency dependency = (Dependency) iterator.next();

Modified: geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenConfigStore.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenConfigStore.java?rev=390312&r1=390311&r2=390312&view=diff
==============================================================================
--- geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenConfigStore.java (original)
+++ geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenConfigStore.java Thu Mar 30 19:48:25 2006
@@ -23,11 +23,11 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.kernel.config.ConfigurationData;
-import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.WritableListableRepository;
+import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.system.configuration.ExecutableConfigurationUtil;
 import org.apache.geronimo.system.configuration.RepositoryConfigurationStore;
 
@@ -39,8 +39,8 @@
  * @version $Rev$ $Date$
  */
 public class MavenConfigStore extends RepositoryConfigurationStore {
-    public MavenConfigStore(String objectName, WritableListableRepository repository) {
-        super(null, objectName, repository);
+    public MavenConfigStore(Kernel kernel, String objectName, WritableListableRepository repository) {
+        super(kernel, objectName, repository);
     }
 
     public File createNewConfigurationDir(Artifact configId) {
@@ -87,11 +87,10 @@
 
     static {
         GBeanInfoBuilder builder = GBeanInfoBuilder.createStatic(MavenConfigStore.class, "ConfigurationStore");
-        builder.addInterface(ConfigurationStore.class);
-        builder.addInterface(ConfigurationStore.class);
+        builder.addAttribute("kernel", Kernel.class, false);
         builder.addAttribute("objectName", String.class, false);
         builder.addReference("Repository", WritableListableRepository.class, "Repository");
-        builder.setConstructor(new String[]{"objectName", "Repository"});
+        builder.setConstructor(new String[]{"kernel", "objectName", "Repository"});
         GBEAN_INFO = builder.getBeanInfo();
     }
 }



Mime
View raw message