geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r630315 - in /geronimo/server/branches/2.1: buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ framework/modules...
Date Fri, 22 Feb 2008 20:48:59 GMT
Author: djencks
Date: Fri Feb 22 12:48:50 2008
New Revision: 630315

URL: http://svn.apache.org/viewvc?rev=630315&view=rev
Log:
GERONIMO-3840 GERONIMO-3841 Load modules in dependency order.  Allow bundles of config changes.  Port from trunk

Added:
    geronimo/server/branches/2.1/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/Override.java
      - copied unchanged from r620730, geronimo/server/trunk/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/Override.java
    geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockConfigurationManager.java
      - copied unchanged from r620870, geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockConfigurationManager.java
Removed:
    geronimo/server/branches/2.1/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/InstallArtifactsMojo.java
Modified:
    geronimo/server/branches/2.1/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/InstallModulesMojo.java
    geronimo/server/branches/2.1/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java
    geronimo/server/branches/2.1/framework/modules/geronimo-deployment/pom.xml
    geronimo/server/branches/2.1/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/DeploymentContextTest.java
    geronimo/server/branches/2.1/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java
    geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationManager.java
    geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
    geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstaller.java
    geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
    geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/CopyFileTest.java
    geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/PluginInstallerTest.java
    geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java
    geronimo/server/branches/2.1/plugins/connector/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java
    geronimo/server/branches/2.1/plugins/connector/geronimo-connector/pom.xml
    geronimo/server/branches/2.1/plugins/j2ee/geronimo-security-builder/pom.xml
    geronimo/server/branches/2.1/plugins/j2ee/geronimo-security-builder/src/test/java/org/apache/geronimo/security/deployment/LoginConfigBuilderTest.java

Modified: geronimo/server/branches/2.1/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/InstallModulesMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/InstallModulesMojo.java?rev=630315&r1=630314&r2=630315&view=diff
==============================================================================
--- geronimo/server/branches/2.1/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/InstallModulesMojo.java (original)
+++ geronimo/server/branches/2.1/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/InstallModulesMojo.java Fri Feb 22 12:48:50 2008
@@ -36,6 +36,7 @@
 import org.apache.geronimo.system.plugin.model.PluginArtifactType;
 import org.apache.geronimo.system.plugin.model.PluginListType;
 import org.apache.geronimo.system.plugin.model.PluginType;
+import org.apache.geronimo.system.plugin.model.AttributesType;
 import org.apache.geronimo.system.resolver.AliasedArtifactResolver;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.codehaus.mojo.pluginsupport.dependency.DependencyTree;
@@ -116,6 +117,18 @@
 
     private RepositoryConfigurationStore sourceStore;
 
+
+    /**
+     * @parameter expression="${project.build.directory}/classes/var/config/overrides"
+     * @required
+     */
+    private File overridesDir;
+
+    /**
+     * @parameter
+     */
+    private List<Override> overrides;
+
     /**
      * Set of artifacts which have already been installed, so we can skip any processing.
      */
@@ -148,6 +161,12 @@
         try {
             PluginInstallerGBean installer = new PluginInstallerGBean(targetRepositoryPath, targetServerPath, servers, kernel, getClass().getClassLoader());
             installer.install(pluginList, sourceRepo, true, null, null, downloadPoller);
+            if (overrides != null) {
+                for (Override override: this.overrides) {
+                    AttributesType attributes = override.getOverrides(overridesDir);
+                    installer.mergeOverrides(override.getServer(), attributes);
+                }
+            }
         } finally {
             kernel.shutdown();
         }

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java?rev=630315&r1=630314&r2=630315&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java (original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java Fri Feb 22 12:48:50 2008
@@ -55,6 +55,7 @@
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Dependency;
 import org.apache.geronimo.kernel.repository.MissingDependencyException;
+import org.apache.geronimo.kernel.InvalidGBeanException;
 import org.apache.geronimo.system.jmx.KernelDelegate;
 import org.apache.geronimo.system.plugin.DownloadPoller;
 import org.apache.geronimo.system.plugin.DownloadResults;
@@ -63,6 +64,7 @@
 import org.apache.geronimo.system.plugin.ServerArchiver;
 import org.apache.geronimo.system.plugin.model.PluginListType;
 import org.apache.geronimo.system.plugin.model.PluginType;
+import org.apache.geronimo.system.plugin.model.AttributesType;
 import org.codehaus.plexus.archiver.ArchiverException;
 
 /**
@@ -344,6 +346,15 @@
         PluginInstaller installer = getPluginInstaller();
         try {
             return installer.installPluginList(targetRepositoryPath, relativeTargetServerPath, pluginList);
+        } finally {
+            kernel.getProxyManager().destroyProxy(installer);
+        }
+    }
+
+    public void mergeOverrides(String server, AttributesType overrides) throws InvalidGBeanException, IOException {
+        PluginInstaller installer = getPluginInstaller();
+        try {
+            installer.mergeOverrides(server, overrides);
         } finally {
             kernel.getProxyManager().destroyProxy(installer);
         }

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-deployment/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-deployment/pom.xml?rev=630315&r1=630314&r2=630315&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-deployment/pom.xml (original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-deployment/pom.xml Fri Feb 22 12:48:50 2008
@@ -52,6 +52,15 @@
             <groupId>xml-resolver</groupId>
             <artifactId>xml-resolver</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>geronimo-kernel</artifactId>
+            <version>${version}</version>
+            <classifier>tests</classifier>
+            <scope>test</scope>
+        </dependency>
+
     </dependencies>
     
 </project>

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/DeploymentContextTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/DeploymentContextTest.java?rev=630315&r1=630314&r2=630315&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/DeploymentContextTest.java (original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/DeploymentContextTest.java Fri Feb 22 12:48:50 2008
@@ -21,12 +21,10 @@
 import java.net.URI;
 import java.net.URL;
 import java.net.URLClassLoader;
+import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Map;
 import java.util.HashMap;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Collection;
+import java.util.Map;
 import java.util.jar.JarFile;
 
 import javax.sql.DataSource;
@@ -35,29 +33,19 @@
 import net.sf.cglib.core.DefaultGeneratorStrategy;
 import net.sf.cglib.proxy.Enhancer;
 import net.sf.cglib.proxy.MethodInterceptor;
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.deployment.util.DeploymentUtil;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.kernel.Jsr77Naming;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.SimpleConfigurationManager;
-import org.apache.geronimo.kernel.config.ConfigurationManager;
-import org.apache.geronimo.kernel.config.ConfigurationStore;
-import org.apache.geronimo.kernel.config.NoSuchStoreException;
-import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.config.LifecycleResults;
-import org.apache.geronimo.kernel.config.NoSuchConfigException;
-import org.apache.geronimo.kernel.config.LifecycleException;
-import org.apache.geronimo.kernel.config.ConfigurationData;
-import org.apache.geronimo.kernel.config.LifecycleMonitor;
+import org.apache.geronimo.kernel.mock.MockConfigurationManager;
 import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.repository.ArtifactManager;
-import org.apache.geronimo.kernel.repository.DefaultArtifactManager;
 import org.apache.geronimo.kernel.repository.ArtifactResolver;
+import org.apache.geronimo.kernel.repository.DefaultArtifactManager;
 import org.apache.geronimo.kernel.repository.DefaultArtifactResolver;
-import org.apache.geronimo.kernel.repository.Version;
-import org.apache.geronimo.kernel.repository.Repository;
-import org.apache.geronimo.deployment.util.DeploymentUtil;
-import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.kernel.repository.Environment;
 
 /**
  * @version $Rev$ $Date$
@@ -264,152 +252,5 @@
         context.getCompleteManifestClassPath(start, start.getRelativeURI(), resolutionURI, classPathList, exclusions, factory, new ArrayList<DeploymentException>());
         assertEquals(2, classPathList.size());
     }
-
-
-    static class MockConfigurationManager implements ConfigurationManager {
-
-        public boolean isInstalled(Artifact configurationId) {
-            return false;
-        }
-
-        public boolean isLoaded(Artifact configurationId) {
-            return false;
-        }
-
-        public boolean isRunning(Artifact configurationId) {
-            return false;
-        }
-
-        public Artifact[] getInstalled(Artifact query) {
-            return new Artifact[0];
-        }
-
-        public Artifact[] getLoaded(Artifact query) {
-            return new Artifact[0];
-        }
-
-        public Artifact[] getRunning(Artifact query) {
-            return new Artifact[0];
-        }
-
-        public List listConfigurations() {
-            return null;
-        }
-
-        public List listStores() {
-            return null;
-        }
-
-        public ConfigurationStore[] getStores() {
-            return new ConfigurationStore[0];
-        }
-
-        public ConfigurationStore getStoreForConfiguration(Artifact configuration) {
-            return null;
-        }
-
-        public List listConfigurations(AbstractName store) throws NoSuchStoreException {
-            return null;
-        }
-
-        public boolean isConfiguration(Artifact artifact) {
-            return false;
-        }
-
-        public Configuration getConfiguration(Artifact configurationId) {
-            return null;
-        }
-
-        public LifecycleResults loadConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults loadConfiguration(ConfigurationData configurationData) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults loadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults loadConfiguration(ConfigurationData configurationData, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults unloadConfiguration(Artifact configurationId) throws NoSuchConfigException {
-            return null;
-        }
-
-        public LifecycleResults unloadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException {
-            return null;
-        }
-
-        public LifecycleResults startConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults startConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults stopConfiguration(Artifact configurationId) throws NoSuchConfigException {
-            return null;
-        }
-
-        public LifecycleResults stopConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException {
-            return null;
-        }
-
-        public LifecycleResults restartConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults restartConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId, Version version) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId, Version version, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(ConfigurationData configurationData) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(ConfigurationData configurationData, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public void uninstallConfiguration(Artifact configurationId) throws IOException, NoSuchConfigException {
-        }
-
-        public ArtifactResolver getArtifactResolver() {
-            return null;
-        }
-
-        public boolean isOnline() {
-            return false;
-        }
-
-        public void setOnline(boolean online) {
-        }
-
-        public Collection<? extends Repository> getRepositories() {
-            return null;
-        }
-    }
-
 
 }

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java?rev=630315&r1=630314&r2=630315&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java (original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java Fri Feb 22 12:48:50 2008
@@ -25,12 +25,14 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.Set;
+import java.util.LinkedHashSet;
 import java.util.jar.JarFile;
 
 import junit.framework.TestCase;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.kernel.Jsr77Naming;
+import org.apache.geronimo.kernel.mock.MockConfigStore;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationAlreadyExistsException;
 import org.apache.geronimo.kernel.config.ConfigurationData;
@@ -52,6 +54,7 @@
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.repository.Version;
 import org.apache.geronimo.kernel.repository.Repository;
+import org.apache.geronimo.kernel.repository.MissingDependencyException;
 
 
 /**
@@ -70,7 +73,7 @@
     private File dir;
     private String[] watchPaths;
     private MockConfigurationBuilder builder;
-    private MockConfigurationStore store;
+    private MockConfigStore store;
     private MockConfigurationManager configurationManager;
 
     private ArtifactResolver artifactResolver = new DefaultArtifactResolver(null, null);
@@ -103,7 +106,7 @@
         watchFile2 = new File(dir, watch2);
 
         builder = new MockConfigurationBuilder();
-        store = new MockConfigurationStore();
+        store = new MockConfigStore();
         configurationManager = new MockConfigurationManager();
     }
 
@@ -277,7 +280,8 @@
         }
     }
 
-    private class MockConfigurationStore implements ConfigurationStore {
+/*
+    private static  class MockConfigurationStore implements ConfigurationStore {
         public boolean isInPlaceConfiguration(Artifact configId) throws NoSuchConfigException, IOException {
             throw new UnsupportedOperationException();
         }
@@ -321,8 +325,9 @@
             throw new UnsupportedOperationException();
         }
     }
+*/
 
-    private class MockConfigurationManager implements ConfigurationManager {
+    private class MockConfigurationManager extends org.apache.geronimo.kernel.mock.MockConfigurationManager {
         private ConfigurationData loadedConfigurationData;
 
         public boolean isInstalled(Artifact configurationId) {
@@ -333,46 +338,14 @@
             return isConfigurationAlreadyLoaded;
         }
 
-        public boolean isRunning(Artifact configurationId) {
-            throw new UnsupportedOperationException();
-        }
-
-        public Artifact[] getInstalled(Artifact query) {
-            throw new UnsupportedOperationException();
-        }
-
-        public Artifact[] getLoaded(Artifact query) {
-            throw new UnsupportedOperationException();
-        }
-
-        public Artifact[] getRunning(Artifact query) {
-            throw new UnsupportedOperationException();
-        }
-
         public List listConfigurations() {
             return existingConfigurationInfos;
         }
 
-        public List listStores() {
-            throw new UnsupportedOperationException();
-        }
-
         public ConfigurationStore[] getStores() {
             return new ConfigurationStore[]{store};
         }
 
-        public ConfigurationStore getStoreForConfiguration(Artifact configuration) {
-            throw new UnsupportedOperationException();
-        }
-
-        public List listConfigurations(AbstractName store) throws NoSuchStoreException {
-            throw new UnsupportedOperationException();
-        }
-
-        public boolean isConfiguration(Artifact artifact) {
-            throw new UnsupportedOperationException();
-        }
-
         public Configuration getConfiguration(Artifact configurationId) {
             try {
                 return new Configuration(Collections.EMPTY_SET, loadedConfigurationData, new ConfigurationResolver(configurationId, dir), null);
@@ -391,72 +364,14 @@
             return null;
         }
 
-        public LifecycleResults loadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            throw new UnsupportedOperationException();
-        }
-
-        public LifecycleResults loadConfiguration(ConfigurationData configurationData, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            throw new UnsupportedOperationException();
-        }
-
-        public LifecycleResults unloadConfiguration(Artifact configurationId) throws NoSuchConfigException {
+       public LifecycleResults unloadConfiguration(Artifact configurationId) throws NoSuchConfigException {
             assertTrue("Did not expect configuration to be unloaded " + configurationId, shouldUnload);
             return null;
         }
-
-        public LifecycleResults unloadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException {
-            throw new UnsupportedOperationException();
-        }
-
         public LifecycleResults startConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
             assertTrue("Did not expect configuration to be started " + configurationId, shouldStart);
             return null;
         }
-
-        public LifecycleResults startConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            throw new UnsupportedOperationException();
-        }
-
-        public LifecycleResults stopConfiguration(Artifact configurationId) throws NoSuchConfigException {
-            throw new UnsupportedOperationException();
-        }
-
-        public LifecycleResults stopConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException {
-            throw new UnsupportedOperationException();
-        }
-
-        public LifecycleResults restartConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            throw new UnsupportedOperationException();
-        }
-
-        public LifecycleResults restartConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            throw new UnsupportedOperationException();
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            throw new UnsupportedOperationException();
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            throw new UnsupportedOperationException();
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId, Version version) throws NoSuchConfigException, LifecycleException {
-            throw new UnsupportedOperationException();
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId, Version version, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            throw new UnsupportedOperationException();
-        }
-
-        public LifecycleResults reloadConfiguration(ConfigurationData configurationData) throws NoSuchConfigException, LifecycleException {
-            throw new UnsupportedOperationException();
-        }
-
-        public LifecycleResults reloadConfiguration(ConfigurationData configurationData, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            throw new UnsupportedOperationException();
-        }
-
         public void uninstallConfiguration(Artifact configurationId) throws IOException, NoSuchConfigException {
             assertTrue("Did not expect configuration to be uninstalled " + configurationId, shouldUninstall);
         }
@@ -465,15 +380,5 @@
             return artifactResolver;
         }
 
-        public boolean isOnline() {
-            return true;
-        }
-
-        public void setOnline(boolean online) {
-        }
-
-        public Collection<? extends Repository> getRepositories() {
-            return null;
-        }
     }
 }

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationManager.java?rev=630315&r1=630314&r2=630315&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationManager.java (original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationManager.java Fri Feb 22 12:48:50 2008
@@ -19,11 +19,13 @@
 import java.io.IOException;
 import java.util.List;
 import java.util.Collection;
+import java.util.LinkedHashSet;
 
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.ArtifactResolver;
 import org.apache.geronimo.kernel.repository.Version;
 import org.apache.geronimo.kernel.repository.Repository;
+import org.apache.geronimo.kernel.repository.MissingDependencyException;
 import org.apache.geronimo.gbean.AbstractName;
 
 /**
@@ -500,4 +502,6 @@
     void setOnline(boolean online);
 
     Collection<? extends Repository> getRepositories();
+
+    LinkedHashSet<Artifact> sort(List<Artifact> ids, LifecycleMonitor monitor) throws InvalidConfigException, IOException, NoSuchConfigException, MissingDependencyException;
 }

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java?rev=630315&r1=630314&r2=630315&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java (original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java Fri Feb 22 12:48:50 2008
@@ -68,11 +68,11 @@
     public SimpleConfigurationManager(Collection stores, ArtifactResolver artifactResolver, Collection<? extends Repository> repositories) {
         this(stores, artifactResolver, repositories, Collections.EMPTY_SET);
     }
-    
+
     public SimpleConfigurationManager(Collection stores,
-            ArtifactResolver artifactResolver,
-            Collection<? extends Repository> repositories,
-            Collection watchers) {
+                                      ArtifactResolver artifactResolver,
+                                      Collection<? extends Repository> repositories,
+                                      Collection watchers) {
         if (stores == null) stores = Collections.EMPTY_SET;
         if (repositories == null) repositories = Collections.emptySet();
         if (watchers == null) watchers = Collections.EMPTY_SET;
@@ -84,13 +84,13 @@
     }
 
     public synchronized boolean isInstalled(Artifact configId) {
-        if(!configId.isResolved()) {
-            throw new IllegalArgumentException("Artifact "+configId+" is not fully resolved");
+        if (!configId.isResolved()) {
+            throw new IllegalArgumentException("Artifact " + configId + " is not fully resolved");
         }
         List storeSnapshot = getStoreList();
         for (int i = 0; i < storeSnapshot.size(); i++) {
             ConfigurationStore store = (ConfigurationStore) storeSnapshot.get(i);
-            if(store.containsConfiguration(configId)) {
+            if (store.containsConfiguration(configId)) {
                 return true;
             }
         }
@@ -98,18 +98,18 @@
     }
 
     public synchronized boolean isLoaded(Artifact configId) {
-        if(!configId.isResolved()) {
-            throw new IllegalArgumentException("Artifact "+configId+" is not fully resolved");
+        if (!configId.isResolved()) {
+            throw new IllegalArgumentException("Artifact " + configId + " is not fully resolved");
         }
-        if(reloadingConfiguration != null && reloadingConfiguration.getId().equals(configId)) {
+        if (reloadingConfiguration != null && reloadingConfiguration.getId().equals(configId)) {
             return true;
         }
         return configurationModel.isLoaded(configId);
     }
 
     public synchronized boolean isRunning(Artifact configId) {
-        if(!configId.isResolved()) {
-            throw new IllegalArgumentException("Artifact "+configId+" is not fully resolved");
+        if (!configId.isResolved()) {
+            throw new IllegalArgumentException("Artifact " + configId + " is not fully resolved");
         }
         return configurationModel.isStarted(configId);
     }
@@ -119,11 +119,11 @@
         List configs = new ArrayList();
         for (int i = 0; i < all.length; i++) {
             Artifact artifact = all[i];
-            if(isConfiguration(artifact)) {
+            if (isConfiguration(artifact)) {
                 configs.add(artifact);
             }
         }
-        if(configs.size() == all.length) {
+        if (configs.size() == all.length) {
             return all;
         }
         return (Artifact[]) configs.toArray(new Artifact[configs.size()]);
@@ -168,13 +168,13 @@
     }
 
     public ConfigurationStore getStoreForConfiguration(Artifact configId) {
-        if(!configId.isResolved()) {
-            throw new IllegalArgumentException("Artifact "+configId+" is not fully resolved");
+        if (!configId.isResolved()) {
+            throw new IllegalArgumentException("Artifact " + configId + " is not fully resolved");
         }
         List storeSnapshot = getStoreList();
         for (int i = 0; i < storeSnapshot.size(); i++) {
             ConfigurationStore store = (ConfigurationStore) storeSnapshot.get(i);
-            if(store.containsConfiguration(configId)) {
+            if (store.containsConfiguration(configId)) {
                 return store;
             }
         }
@@ -220,8 +220,8 @@
     }
 
     public boolean isConfiguration(Artifact artifact) {
-        if(!artifact.isResolved()) {
-            throw new IllegalArgumentException("Artifact "+artifact+" is not fully resolved");
+        if (!artifact.isResolved()) {
+            throw new IllegalArgumentException("Artifact " + artifact + " is not fully resolved");
         }
         synchronized (this) {
             // if it is loaded, it is definitely a configuration
@@ -242,10 +242,10 @@
     }
 
     public synchronized Configuration getConfiguration(Artifact configurationId) {
-        if(!configurationId.isResolved()) {
-            throw new IllegalArgumentException("Artifact "+configurationId+" is not fully resolved");
+        if (!configurationId.isResolved()) {
+            throw new IllegalArgumentException("Artifact " + configurationId + " is not fully resolved");
         }
-        if(reloadingConfiguration != null && reloadingConfiguration.getId().equals(configurationId)) {
+        if (reloadingConfiguration != null && reloadingConfiguration.getId().equals(configurationId)) {
             return reloadingConfiguration;
         }
         return (Configuration) configurations.get(configurationId);
@@ -256,8 +256,8 @@
     }
 
     public synchronized LifecycleResults loadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-        if(!configurationId.isResolved()) {
-            throw new IllegalArgumentException("Artifact "+configurationId+" is not fully resolved");
+        if (!configurationId.isResolved()) {
+            throw new IllegalArgumentException("Artifact " + configurationId + " is not fully resolved");
         }
         if (isLoaded(configurationId)) {
             // already loaded, so just mark the configuration as user loaded
@@ -414,25 +414,23 @@
         return startParent;
     }
 
-    private static LinkedHashSet getConfigurationIds(Collection configurations) {
-        LinkedHashSet configurationIds = new LinkedHashSet(configurations.size());
-        for (Iterator iterator = configurations.iterator(); iterator.hasNext();) {
-            Configuration configuration = (Configuration) iterator.next();
+    private static LinkedHashSet<Artifact> getConfigurationIds(Collection<Configuration> configurations) {
+        LinkedHashSet<Artifact> configurationIds = new LinkedHashSet<Artifact>(configurations.size());
+        for (Configuration configuration : configurations) {
             configurationIds.add(configuration.getId());
         }
         return configurationIds;
     }
 
-    private synchronized void loadDepthFirst(ConfigurationData configurationData, LinkedHashMap configurationsToLoad, LifecycleMonitor monitor) throws NoSuchConfigException, IOException, InvalidConfigException, MissingDependencyException {
+    private synchronized void loadDepthFirst(ConfigurationData configurationData, LinkedHashMap<Artifact, UnloadedConfiguration> configurationsToLoad, LifecycleMonitor monitor) throws NoSuchConfigException, IOException, InvalidConfigException, MissingDependencyException {
         // if this parent hasn't already been processed, iterate into the parent
         Artifact configurationId = configurationData.getId();
         if (!configurationsToLoad.containsKey(configurationId)) {
             monitor.resolving(configurationId);
-            LinkedHashSet resolvedParentIds = resolveParentIds(configurationData);
+            LinkedHashSet<Artifact> resolvedParentIds = resolveParentIds(configurationData);
             monitor.succeeded(configurationId);
-            
-            for (Iterator iterator = resolvedParentIds.iterator(); iterator.hasNext();) {
-                Artifact parentId = (Artifact) iterator.next();
+
+            for (Artifact parentId : resolvedParentIds) {
                 // if this parent id hasn't already been loaded and is actually a configuration
                 if (!isLoaded(parentId) && isConfiguration(parentId)) {
                     ConfigurationData parentConfigurationData = loadConfigurationData(parentId, monitor);
@@ -445,13 +443,30 @@
         }
     }
 
+    public LinkedHashSet<Artifact> sort(List<Artifact> ids, LifecycleMonitor monitor) throws InvalidConfigException, IOException, NoSuchConfigException, MissingDependencyException {
+        LinkedHashSet<Artifact> sorted = new LinkedHashSet<Artifact>();
+        sort(ids, sorted, monitor);
+        sorted.retainAll(ids);
+        return sorted;
+    }
+
+    private void sort(Collection<Artifact> ids, LinkedHashSet<Artifact> sorted, LifecycleMonitor monitor) throws InvalidConfigException, IOException, NoSuchConfigException, MissingDependencyException {
+        for (Artifact id : ids) {
+            if (!sorted.contains(id)) {
+                ConfigurationData data = loadConfigurationData(id, monitor);
+                LinkedHashSet<Artifact> parents = resolveParentIds(data);
+                sort(parents, sorted, monitor);
+                sorted.add(id);
+            }
+        }
+    }
+
     private ConfigurationData loadConfigurationData(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, IOException, InvalidConfigException {
-        List storeSnapshot = getStoreList();
+        List<ConfigurationStore> storeSnapshot = getStoreList();
 
         monitor.addConfiguration(configurationId);
         monitor.reading(configurationId);
-        for (int i = 0; i < storeSnapshot.size(); i++) {
-            ConfigurationStore store = (ConfigurationStore) storeSnapshot.get(i);
+        for (ConfigurationStore store : storeSnapshot) {
             if (store.containsConfiguration(configurationId)) {
                 ConfigurationData configurationData = store.loadConfiguration(configurationId);
                 monitor.succeeded(configurationId);
@@ -515,9 +530,9 @@
         return startConfiguration(id, NullLifecycleMonitor.INSTANCE);
     }
 
-    public synchronized LifecycleResults startConfiguration(Artifact id, LifecycleMonitor monitor) throws  NoSuchConfigException, LifecycleException {
-        if(!id.isResolved()) {
-            throw new IllegalArgumentException("Artifact "+id+" is not fully resolved");
+    public synchronized LifecycleResults startConfiguration(Artifact id, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
+        if (!id.isResolved()) {
+            throw new IllegalArgumentException("Artifact " + id + " is not fully resolved");
         }
         LinkedHashSet unstartedConfigurations = configurationModel.start(id);
 
@@ -563,8 +578,8 @@
     }
 
     public synchronized LifecycleResults stopConfiguration(Artifact id, LifecycleMonitor monitor) throws NoSuchConfigException {
-        if(!id.isResolved()) {
-            throw new IllegalArgumentException("Artifact "+id+" is not fully resolved");
+        if (!id.isResolved()) {
+            throw new IllegalArgumentException("Artifact " + id + " is not fully resolved");
         }
         LinkedHashSet stopList = configurationModel.stop(id);
 
@@ -596,8 +611,8 @@
     }
 
     public synchronized LifecycleResults restartConfiguration(Artifact id, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-        if(!id.isResolved()) {
-            throw new IllegalArgumentException("Artifact "+id+" is not fully resolved");
+        if (!id.isResolved()) {
+            throw new IllegalArgumentException("Artifact " + id + " is not fully resolved");
         }
         // get a sorted list of configurations to restart
         LinkedHashSet restartList = configurationModel.restart(id);
@@ -676,8 +691,8 @@
     }
 
     public synchronized LifecycleResults unloadConfiguration(Artifact id, LifecycleMonitor monitor) throws NoSuchConfigException {
-        if(!id.isResolved()) {
-            throw new IllegalArgumentException("Artifact "+id+" is not fully resolved");
+        if (!id.isResolved()) {
+            throw new IllegalArgumentException("Artifact " + id + " is not fully resolved");
         }
         Set started = configurationModel.getStarted();
         LinkedHashSet unloadList = configurationModel.unload(id);
@@ -714,7 +729,7 @@
     }
 
     protected void removeConfigurationFromModel(Artifact configurationId) throws NoSuchConfigException {
-        if(configurationModel.containsConfiguration(configurationId)) {
+        if (configurationModel.containsConfiguration(configurationId)) {
             configurationModel.removeConfiguration(configurationId);
         }
         configurations.remove(configurationId);
@@ -741,8 +756,8 @@
     }
 
     public synchronized LifecycleResults reloadConfiguration(Artifact id, Version version, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-        if(!id.isResolved()) {
-            throw new IllegalArgumentException("Artifact "+id+" is not fully resolved");
+        if (!id.isResolved()) {
+            throw new IllegalArgumentException("Artifact " + id + " is not fully resolved");
         }
         Configuration configuration = getConfiguration(id);
         if (configuration == null) { // The configuration to reload is not currently loaded
@@ -754,11 +769,11 @@
                     try {
                         data = store.loadConfiguration(id);
                     } catch (Exception e) {
-                        log.warn("Unable to load existing configuration "+id+" from config store", e);
+                        log.warn("Unable to load existing configuration " + id + " from config store", e);
                     }
                 }
             }
-            if(data == null) {
+            if (data == null) {
                 throw new NoSuchConfigException(id);
             }
             UnloadedConfiguration existingUnloadedConfiguration = new UnloadedConfiguration(data, new LinkedHashSet());
@@ -929,11 +944,11 @@
             stop(existingConfiguration);
             monitor.succeeded(existingConfigurationId);
             results.addStopped(existingConfigurationId);
-        } else if(existingConfiguration != null) {
+        } else if (existingConfiguration != null) {
             // call stop just to be sure the beans aren't running
             stop(existingConfiguration);
         }
-        if(existingConfiguration != null) {
+        if (existingConfiguration != null) {
             monitor.unloading(existingConfigurationId);
             unload(existingConfiguration);
             monitor.succeeded(existingConfigurationId);
@@ -944,7 +959,8 @@
         // load the new configurations
         //
         boolean reinstatedExisting = false;
-        /* reduce variable scope */ {
+        /* reduce variable scope */
+        {
             Map loadedParents = new LinkedHashMap();
             Map startedParents = new LinkedHashMap();
             Configuration newConfiguration = null;
@@ -1024,7 +1040,7 @@
                 addNewConfigurationsToModel(loadedParents);
 
                 // now ugrade the existing node in the model
-                if(configurationModel.containsConfiguration(existingConfigurationId)) {
+                if (configurationModel.containsConfiguration(existingConfigurationId)) {
                     configurationModel.upgradeConfiguration(existingConfigurationId,
                             newConfigurationId,
                             getConfigurationIds(getLoadParents(newConfiguration)),
@@ -1141,7 +1157,6 @@
                     reloadingConfiguration = configuration;
                     monitor.succeeded(configurationId);
 
-
                     // if the configuration was started before restart it
                     if (started.contains(configurationId)) {
                         monitor.starting(configurationId);
@@ -1197,11 +1212,11 @@
         //
         // If nothing failed, delete all the unloaded modules that weren't reloaded
         //
-        if(!results.wasLoaded(existingConfigurationId) && !results.wasFailed(existingConfigurationId)) {
+        if (!results.wasLoaded(existingConfigurationId) && !results.wasFailed(existingConfigurationId)) {
             try {
                 uninstallConfiguration(existingConfigurationId);
             } catch (IOException e) {
-                log.error("Unable to uninstall configuration "+existingConfigurationId, e);
+                log.error("Unable to uninstall configuration " + existingConfigurationId, e);
             }
         }
 
@@ -1234,14 +1249,14 @@
     }
 
     public synchronized void uninstallConfiguration(Artifact configurationId) throws IOException, NoSuchConfigException {
-        if(!configurationId.isResolved()) {
-            throw new IllegalArgumentException("Artifact "+configurationId+" is not fully resolved");
+        if (!configurationId.isResolved()) {
+            throw new IllegalArgumentException("Artifact " + configurationId + " is not fully resolved");
         }
         if (configurations.containsKey(configurationId)) {
-            if(isRunning(configurationId)) {
+            if (isRunning(configurationId)) {
                 stopConfiguration(configurationId);
             }
-            if(isLoaded((configurationId))) {
+            if (isLoaded((configurationId))) {
                 unloadConfiguration(configurationId);
             }
         }
@@ -1250,7 +1265,7 @@
         List storeSnapshot = getStoreList();
         for (int i = 0; i < storeSnapshot.size(); i++) {
             ConfigurationStore store = (ConfigurationStore) storeSnapshot.get(i);
-            if(store.containsConfiguration(configurationId)) {
+            if (store.containsConfiguration(configurationId)) {
                 store.uninstall(configurationId);
             }
         }
@@ -1276,6 +1291,7 @@
 
     /**
      * this configuration manager never starts configurations.
+     *
      * @return false
      */
     public boolean isOnline() {

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstaller.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstaller.java?rev=630315&r1=630314&r2=630315&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstaller.java (original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstaller.java Fri Feb 22 12:48:50 2008
@@ -26,13 +26,15 @@
 import org.apache.geronimo.kernel.repository.MissingDependencyException;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.NoSuchStoreException;
+import org.apache.geronimo.kernel.InvalidGBeanException;
 import org.apache.geronimo.system.plugin.model.PluginListType;
 import org.apache.geronimo.system.plugin.model.PluginType;
+import org.apache.geronimo.system.plugin.model.AttributesType;
 
 /**
  * Knows how to import and export configurations
  *
- * @version $Rev: 601152 $ $Date: 2007-12-04 15:49:03 -0800 (Tue, 04 Dec 2007) $
+ * @version $Rev$ $Date$
  */
 public interface PluginInstaller {
     /**
@@ -189,4 +191,6 @@
     public Artifact installLibrary(File libFile, String groupId) throws IOException;
 
     DownloadResults installPluginList(String targetRepositoryPath, String relativeTargetServerPath, PluginListType pluginList) throws Exception;
+
+    void mergeOverrides(String server, AttributesType overrides) throws InvalidGBeanException, IOException;
 }

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java?rev=630315&r1=630314&r2=630315&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java (original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java Fri Feb 22 12:48:50 2008
@@ -81,6 +81,7 @@
 import org.apache.geronimo.kernel.util.XmlUtil;
 import org.apache.geronimo.system.configuration.ConfigurationStoreUtil;
 import org.apache.geronimo.system.configuration.RepositoryConfigurationStore;
+import org.apache.geronimo.system.configuration.PluginAttributeStore;
 import org.apache.geronimo.system.plugin.model.ArtifactType;
 import org.apache.geronimo.system.plugin.model.ConfigXmlContentType;
 import org.apache.geronimo.system.plugin.model.CopyFileType;
@@ -92,6 +93,8 @@
 import org.apache.geronimo.system.plugin.model.PluginType;
 import org.apache.geronimo.system.plugin.model.PrerequisiteType;
 import org.apache.geronimo.system.plugin.model.PropertyType;
+import org.apache.geronimo.system.plugin.model.AttributesType;
+import org.apache.geronimo.system.plugin.model.ModuleType;
 import org.apache.geronimo.system.repository.Maven2Repository;
 import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
@@ -339,6 +342,22 @@
             kernel.shutdown();
         }
         return downloadPoller;
+    }
+
+    public void mergeOverrides(String server, AttributesType overrides) throws InvalidGBeanException, IOException {
+        ServerInstance serverInstance = servers.get(server);
+        if (serverInstance == null) {
+            throw new NullPointerException("No such server: " + server + ", known servers: " + servers.keySet());
+        }
+        PluginAttributeStore attributeStore = serverInstance.getAttributeStore();
+        for (ModuleType module: overrides.getModule()) {
+            Artifact artifact = Artifact.create(module.getName());
+            attributeStore.setModuleGBeans(artifact, module.getGbean(), module.isLoad(), module.getCondition());
+            attributeStore.save();
+        }
+        if (overrides.getConfiguration().size() > 0) {
+            throw new UnsupportedOperationException("Use modules, not configurations");
+        }
     }
 
 

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/CopyFileTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/CopyFileTest.java?rev=630315&r1=630314&r2=630315&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/CopyFileTest.java (original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/CopyFileTest.java Fri Feb 22 12:48:50 2008
@@ -23,25 +23,11 @@
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Collection;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.config.ConfigurationData;
-import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
-import org.apache.geronimo.kernel.config.LifecycleException;
-import org.apache.geronimo.kernel.config.LifecycleMonitor;
-import org.apache.geronimo.kernel.config.LifecycleResults;
-import org.apache.geronimo.kernel.config.NoSuchConfigException;
-import org.apache.geronimo.kernel.config.NoSuchStoreException;
 import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.repository.ArtifactResolver;
-import org.apache.geronimo.kernel.repository.Version;
-import org.apache.geronimo.kernel.repository.Repository;
+import org.apache.geronimo.kernel.mock.MockConfigurationManager;
 import org.apache.geronimo.system.configuration.RepositoryConfigurationStore;
 import org.apache.geronimo.system.plugin.model.CopyFileType;
 import org.apache.geronimo.system.repository.Maven2Repository;
@@ -83,7 +69,7 @@
         }
         Maven2Repository repo = new Maven2Repository(repoBase.toURI(), serverInfo, true);
         configStore = new RepositoryConfigurationStore(repo);
-        installer = new PluginInstallerGBean(new MockConfigManager(),
+        installer = new PluginInstallerGBean(new MockConfigurationManager(),
                 repo,
                 configStore,
                 serverInfo,
@@ -170,149 +156,4 @@
         return target;
     }
 
-    private static class MockConfigManager implements ConfigurationManager {
-
-        public boolean isInstalled(Artifact configurationId) {
-            return false;
-        }
-
-        public Artifact[] getInstalled(Artifact query) {
-            return new Artifact[0];
-        }
-
-        public Artifact[] getLoaded(Artifact query) {
-            return new Artifact[0];
-        }
-
-        public Artifact[] getRunning(Artifact query) {
-            return new Artifact[0];
-        }
-
-        public boolean isLoaded(Artifact configID) {
-            return false;
-        }
-
-        public List listStores() {
-            return Collections.EMPTY_LIST;
-        }
-
-        public ConfigurationStore[] getStores() {
-            return new ConfigurationStore[0];
-        }
-
-        public ConfigurationStore getStoreForConfiguration(Artifact configuration) {
-            return null;
-        }
-
-        public List listConfigurations(AbstractName store) throws NoSuchStoreException {
-            return Collections.EMPTY_LIST;
-        }
-
-        public boolean isRunning(Artifact configurationId) {
-            return false;
-        }
-
-        public List listConfigurations() {
-            return null;
-        }
-
-        public boolean isConfiguration(Artifact artifact) {
-            return false;
-        }
-
-        public Configuration getConfiguration(Artifact configurationId) {
-            return null;
-        }
-
-        public LifecycleResults loadConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults loadConfiguration(ConfigurationData configurationData) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults loadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults loadConfiguration(ConfigurationData configurationData, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults unloadConfiguration(Artifact configurationId) throws NoSuchConfigException {
-            return null;
-        }
-
-        public LifecycleResults unloadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException {
-            return null;
-        }
-
-        public LifecycleResults startConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults startConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults stopConfiguration(Artifact configurationId) throws NoSuchConfigException {
-            return null;
-        }
-
-        public LifecycleResults stopConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException {
-            return null;
-        }
-
-        public LifecycleResults restartConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults restartConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId, Version version) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId, Version version, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(ConfigurationData configurationData) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(ConfigurationData configurationData, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public void uninstallConfiguration(Artifact configurationId) throws IOException, NoSuchConfigException {
-
-        }
-
-        public ArtifactResolver getArtifactResolver() {
-            return null;
-        }
-
-        public boolean isOnline() {
-            return true;
-        }
-
-        public void setOnline(boolean online) {
-        }
-
-        public Collection<? extends Repository> getRepositories() {
-            return null;
-        }
-    }
 }

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/PluginInstallerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/PluginInstallerTest.java?rev=630315&r1=630314&r2=630315&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/PluginInstallerTest.java (original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/PluginInstallerTest.java Fri Feb 22 12:48:50 2008
@@ -22,6 +22,7 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
+import java.util.LinkedHashSet;
 import java.util.concurrent.TimeUnit;
 
 import junit.framework.TestCase;
@@ -35,12 +36,15 @@
 import org.apache.geronimo.kernel.config.LifecycleResults;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
 import org.apache.geronimo.kernel.config.NoSuchStoreException;
+import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.mock.MockConfigStore;
 import org.apache.geronimo.kernel.mock.MockWritableListableRepository;
+import org.apache.geronimo.kernel.mock.MockConfigurationManager;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.ArtifactResolver;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.kernel.repository.Version;
+import org.apache.geronimo.kernel.repository.MissingDependencyException;
 import org.apache.geronimo.system.plugin.model.PluginArtifactType;
 import org.apache.geronimo.system.plugin.model.PluginListType;
 import org.apache.geronimo.system.plugin.model.PluginType;
@@ -63,7 +67,7 @@
         String url = getClass().getResource("/geronimo-plugins.xml").toString();
         int pos = url.lastIndexOf("/");
         testRepo = url.substring(0, pos);
-        installer = new PluginInstallerGBean(new MockConfigManager(), new MockWritableListableRepository(), new MockConfigStore(),
+        installer = new PluginInstallerGBean(new MockConfigurationManager(), new MockWritableListableRepository(), new MockConfigStore(),
                 new BasicServerInfo("."), new ThreadPool() {
             public int getPoolSize() {
                 return 0;
@@ -104,150 +108,5 @@
         assertTrue(prereqCount > 0);
     }
 
-    private static class MockConfigManager implements ConfigurationManager {
-
-        public boolean isInstalled(Artifact configurationId) {
-            return false;
-        }
-
-        public Artifact[] getInstalled(Artifact query) {
-            return new Artifact[0];
-        }
-
-        public Artifact[] getLoaded(Artifact query) {
-            return new Artifact[0];
-        }
-
-        public Artifact[] getRunning(Artifact query) {
-            return new Artifact[0];
-        }
-
-        public boolean isLoaded(Artifact configID) {
-            return false;
-        }
-
-        public List listStores() {
-            return Collections.EMPTY_LIST;
-        }
-
-        public ConfigurationStore[] getStores() {
-            return new ConfigurationStore[0];
-        }
-
-        public ConfigurationStore getStoreForConfiguration(Artifact configuration) {
-            return null;
-        }
-
-        public List listConfigurations(AbstractName store) throws NoSuchStoreException {
-            return Collections.EMPTY_LIST;
-        }
-
-        public boolean isRunning(Artifact configurationId) {
-            return false;
-        }
-
-        public List listConfigurations() {
-            return null;
-        }
-
-        public boolean isConfiguration(Artifact artifact) {
-            return false;
-        }
-
-        public Configuration getConfiguration(Artifact configurationId) {
-            return null;
-        }
-
-        public LifecycleResults loadConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults loadConfiguration(ConfigurationData configurationData) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults loadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults loadConfiguration(ConfigurationData configurationData, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults unloadConfiguration(Artifact configurationId) throws NoSuchConfigException {
-            return null;
-        }
-
-        public LifecycleResults unloadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException {
-            return null;
-        }
-
-        public LifecycleResults startConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults startConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults stopConfiguration(Artifact configurationId) throws NoSuchConfigException {
-            return null;
-        }
-
-        public LifecycleResults stopConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException {
-            return null;
-        }
-
-        public LifecycleResults restartConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults restartConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId, Version version) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId, Version version, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(ConfigurationData configurationData) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(ConfigurationData configurationData, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public void uninstallConfiguration(Artifact configurationId) throws IOException, NoSuchConfigException {
-
-        }
-
-        public ArtifactResolver getArtifactResolver() {
-            return null;
-        }
-
-        public boolean isOnline() {
-            return true;
-        }
-
-        public void setOnline(boolean online) {
-        }
-
-        public Collection<? extends Repository> getRepositories() {
-            return null;
-        }
-    }
 
 }

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java?rev=630315&r1=630314&r2=630315&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java (original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java Fri Feb 22 12:48:50 2008
@@ -23,6 +23,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
+import java.util.LinkedHashSet;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -148,7 +149,8 @@
             try {
                 ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
                 try {
-                    for (Artifact configID : configs) {
+                    LinkedHashSet<Artifact> sorted = configurationManager.sort(configs, lifecycleMonitor);
+                    for (Artifact configID : sorted) {
                         monitor.moduleLoading(configID);
                         configurationManager.loadConfiguration(configID, lifecycleMonitor);
                         monitor.moduleLoaded(configID);

Modified: geronimo/server/branches/2.1/plugins/connector/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/connector/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java?rev=630315&r1=630314&r2=630315&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/connector/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java (original)
+++ geronimo/server/branches/2.1/plugins/connector/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java Fri Feb 22 12:48:50 2008
@@ -17,9 +17,7 @@
 package org.apache.geronimo.connector.deployment;
 
 import java.io.File;
-import java.io.IOException;
 import java.util.Collections;
-import java.util.List;
 import java.util.Map;
 import java.util.HashMap;
 import java.util.Collection;
@@ -48,6 +46,7 @@
 import org.apache.geronimo.kernel.config.LifecycleResults;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
 import org.apache.geronimo.kernel.config.NoSuchStoreException;
+import org.apache.geronimo.kernel.mock.MockConfigurationManager;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.ArtifactResolver;
 import org.apache.geronimo.kernel.repository.Environment;
@@ -186,148 +185,5 @@
         }
     }
 
-    private final class MockConfigurationManager implements ConfigurationManager {
-        public boolean isInstalled(Artifact configurationId) {
-            return false;
-        }
-
-        public Artifact[] getInstalled(Artifact query) {
-            return new Artifact[0];
-        }
-
-        public void setOnline(boolean online) {
-        }
-
-        public Collection<? extends Repository> getRepositories() {
-            return null;
-        }
-
-        public boolean isLoaded(Artifact configurationId) {
-            return false;
-        }
-
-        public boolean isRunning(Artifact configurationId) {
-            return false;
-        }
-
-        public Artifact[] getLoaded(Artifact query) {
-            return new Artifact[0];
-        }
-
-        public Artifact[] getRunning(Artifact query) {
-            return new Artifact[0];
-        }
-
-        public List listConfigurations() {
-            return null;
-        }
-
-        public List listStores() {
-            return null;
-        }
-
-        public ConfigurationStore[] getStores() {
-            return new ConfigurationStore[0];
-        }
-
-        public ConfigurationStore getStoreForConfiguration(Artifact configuration) {
-            return null;
-        }
-
-        public List listConfigurations(AbstractName store) throws NoSuchStoreException {
-            return null;
-        }
-
-        public boolean isConfiguration(Artifact artifact) {
-            return false;
-        }
-
-        public Configuration getConfiguration(Artifact configurationId) {
-            return null;
-        }
-
-        public LifecycleResults loadConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults loadConfiguration(ConfigurationData configurationData) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults loadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults loadConfiguration(ConfigurationData configurationData, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults unloadConfiguration(Artifact configurationId) throws NoSuchConfigException {
-            return null;
-        }
-
-        public LifecycleResults unloadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException {
-            return null;
-        }
-
-        public LifecycleResults startConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults startConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults stopConfiguration(Artifact configurationId) throws NoSuchConfigException {
-            return null;
-        }
-
-        public LifecycleResults stopConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException {
-            return null;
-        }
-
-        public LifecycleResults restartConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults restartConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId, Version version) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId, Version version, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(ConfigurationData configurationData) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(ConfigurationData configurationData, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public void uninstallConfiguration(Artifact configurationId) throws IOException, NoSuchConfigException {
-        }
-
-        public ArtifactResolver getArtifactResolver() {
-            return null;
-        }
-
-        public boolean isOnline() {
-            return false;
-        }
-    }
 }
 

Modified: geronimo/server/branches/2.1/plugins/connector/geronimo-connector/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/connector/geronimo-connector/pom.xml?rev=630315&r1=630314&r2=630315&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/connector/geronimo-connector/pom.xml (original)
+++ geronimo/server/branches/2.1/plugins/connector/geronimo-connector/pom.xml Fri Feb 22 12:48:50 2008
@@ -55,6 +55,7 @@
             <groupId>org.apache.geronimo.framework</groupId>
             <artifactId>geronimo-deployment</artifactId>
             <version>${version}</version>
+            <scope>test</scope>
         </dependency>
 
         <dependency>
@@ -80,6 +81,15 @@
             <groupId>regexp</groupId>
             <artifactId>regexp</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>geronimo-kernel</artifactId>
+            <version>${version}</version>
+            <classifier>tests</classifier>
+            <scope>test</scope>
+        </dependency>
+
     </dependencies>
 
 </project>

Modified: geronimo/server/branches/2.1/plugins/j2ee/geronimo-security-builder/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/j2ee/geronimo-security-builder/pom.xml?rev=630315&r1=630314&r2=630315&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/j2ee/geronimo-security-builder/pom.xml (original)
+++ geronimo/server/branches/2.1/plugins/j2ee/geronimo-security-builder/pom.xml Fri Feb 22 12:48:50 2008
@@ -45,6 +45,15 @@
             <artifactId>geronimo-j2ee-builder</artifactId>
             <version>${version}</version>
         </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>geronimo-kernel</artifactId>
+            <version>${version}</version>
+            <classifier>tests</classifier>
+            <scope>test</scope>
+        </dependency>
+
     </dependencies>
     
     <build>

Modified: geronimo/server/branches/2.1/plugins/j2ee/geronimo-security-builder/src/test/java/org/apache/geronimo/security/deployment/LoginConfigBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/j2ee/geronimo-security-builder/src/test/java/org/apache/geronimo/security/deployment/LoginConfigBuilderTest.java?rev=630315&r1=630314&r2=630315&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/j2ee/geronimo-security-builder/src/test/java/org/apache/geronimo/security/deployment/LoginConfigBuilderTest.java (original)
+++ geronimo/server/branches/2.1/plugins/j2ee/geronimo-security-builder/src/test/java/org/apache/geronimo/security/deployment/LoginConfigBuilderTest.java Fri Feb 22 12:48:50 2008
@@ -20,40 +20,23 @@
 
 package org.apache.geronimo.security.deployment;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Collections;
-import java.util.Collection;
-import java.io.IOException;
 import java.io.File;
 import java.net.URI;
+import java.util.Collections;
 
 import junit.framework.TestCase;
-import org.apache.geronimo.kernel.Naming;
-import org.apache.geronimo.kernel.Jsr77Naming;
-import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.repository.Version;
-import org.apache.geronimo.kernel.repository.ArtifactResolver;
-import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.kernel.repository.Repository;
-import org.apache.geronimo.kernel.config.ConfigurationManager;
-import org.apache.geronimo.kernel.config.ConfigurationStore;
-import org.apache.geronimo.kernel.config.NoSuchStoreException;
-import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.config.LifecycleResults;
-import org.apache.geronimo.kernel.config.NoSuchConfigException;
-import org.apache.geronimo.kernel.config.LifecycleException;
-import org.apache.geronimo.kernel.config.ConfigurationData;
-import org.apache.geronimo.kernel.config.LifecycleMonitor;
-import org.apache.geronimo.kernel.config.ConfigurationModuleType;
-import org.apache.geronimo.kernel.util.XmlUtil;
+import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.common.DeploymentException;
-import org.apache.xmlbeans.XmlObject;
+import org.apache.geronimo.kernel.Jsr77Naming;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.kernel.mock.MockConfigurationManager;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
 
 /**
  * @version $Rev$ $Date$
@@ -138,150 +121,6 @@
         AbstractName parentName = new AbstractName(URI.create("test/foo/1.0/car?name=parent,j2eeType=foo"));
         builder.getReferences(xmlObject, context, parentName, getClass().getClassLoader());
         secBuilder.doStop();
-    }
-
-    private static class MockConfigurationManager implements ConfigurationManager {
-        public boolean isInstalled(Artifact configurationId) {
-            return false;
-        }
-
-        public Artifact[] getInstalled(Artifact query) {
-            return new Artifact[0];
-        }
-
-        public void setOnline(boolean online) {
-        }
-
-        public Collection<? extends Repository> getRepositories() {
-            return null;
-        }
-
-        public boolean isLoaded(Artifact configurationId) {
-            return false;
-        }
-
-        public boolean isRunning(Artifact configurationId) {
-            return false;
-        }
-
-        public Artifact[] getLoaded(Artifact query) {
-            return new Artifact[0];
-        }
-
-        public Artifact[] getRunning(Artifact query) {
-            return new Artifact[0];
-        }
-
-        public List listConfigurations() {
-            return null;
-        }
-
-        public List listStores() {
-            return null;
-        }
-
-        public ConfigurationStore[] getStores() {
-            return new ConfigurationStore[0];
-        }
-
-        public ConfigurationStore getStoreForConfiguration(Artifact configuration) {
-            return null;
-        }
-
-        public List listConfigurations(AbstractName store) throws NoSuchStoreException {
-            return null;
-        }
-
-        public boolean isConfiguration(Artifact artifact) {
-            return false;
-        }
-
-        public Configuration getConfiguration(Artifact configurationId) {
-            return null;
-        }
-
-        public LifecycleResults loadConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults loadConfiguration(ConfigurationData configurationData) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults loadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults loadConfiguration(ConfigurationData configurationData, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults unloadConfiguration(Artifact configurationId) throws NoSuchConfigException {
-            return null;
-        }
-
-        public LifecycleResults unloadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException {
-            return null;
-        }
-
-        public LifecycleResults startConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults startConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults stopConfiguration(Artifact configurationId) throws NoSuchConfigException {
-            return null;
-        }
-
-        public LifecycleResults stopConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException {
-            return null;
-        }
-
-        public LifecycleResults restartConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults restartConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId, Version version) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(Artifact configurationId, Version version, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(ConfigurationData configurationData) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public LifecycleResults reloadConfiguration(ConfigurationData configurationData, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
-            return null;
-        }
-
-        public void uninstallConfiguration(Artifact configurationId) throws IOException, NoSuchConfigException {
-        }
-
-        public ArtifactResolver getArtifactResolver() {
-            return null;
-        }
-
-        public boolean isOnline() {
-            return false;
-        }
     }
 
 }



Mime
View raw message