geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r604483 [1/3] - in /geronimo/server/trunk: applications/welcome/geronimo-welcome/src/main/java/org/apache/geronimo/welcome/ framework/configs/rmi-naming/src/main/plan/ framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronim...
Date Sat, 15 Dec 2007 18:28:22 GMT
Author: djencks
Date: Sat Dec 15 10:28:19 2007
New Revision: 604483

URL: http://svn.apache.org/viewvc?rev=604483&view=rev
Log:
GERONIMO-3607 Large cleanup of code for extracting assemblies from running servers.  Should greatly improve dealing with snapshots in local maven repos.  Also changes meaning of plugin dependency start flag to override plugin load flag.

Added:
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/GeronimoSourceRepository.java   (with props)
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/LocalOpenResult.java   (with props)
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/LocalSourceRepository.java   (with props)
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/OpenResult.java   (with props)
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/RemoteSourceRepository.java   (with props)
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/SourceRepository.java   (with props)
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/SourceRepositoryFactory.java   (with props)
Modified:
    geronimo/server/trunk/applications/welcome/geronimo-welcome/src/main/java/org/apache/geronimo/welcome/AbsentSampleServlet.java
    geronimo/server/trunk/framework/configs/rmi-naming/src/main/plan/plan.xml
    geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java
    geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandListConfigurations.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/AbstractNameQuery.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationData.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/AbstractRepository.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Maven2Repository.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Repository.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/WritableListableRepository.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockRepository.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockWritableListableRepository.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/SwitchableLocalAttributeManager.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginRepositoryDownloader.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginRepositoryList.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/xsd/plugins-1.3.xsd
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration/pom.xml
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration/src/test/resources/META-INF/geronimo-plugin.xml
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/Dependency.java
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/MavenConfigStore.java
    geronimo/server/trunk/plugins/client/client-deployer/pom.xml
    geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/main/java/org/apache/geronimo/clustering/deployment/MasterConfigurationStore.java
    geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/MasterConfigurationStoreTest.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/AddRepositoryHandler.java
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/IndexHandler.java
    geronimo/server/trunk/plugins/console/console-jetty/pom.xml

Modified: geronimo/server/trunk/applications/welcome/geronimo-welcome/src/main/java/org/apache/geronimo/welcome/AbsentSampleServlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/welcome/geronimo-welcome/src/main/java/org/apache/geronimo/welcome/AbsentSampleServlet.java?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/applications/welcome/geronimo-welcome/src/main/java/org/apache/geronimo/welcome/AbsentSampleServlet.java (original)
+++ geronimo/server/trunk/applications/welcome/geronimo-welcome/src/main/java/org/apache/geronimo/welcome/AbsentSampleServlet.java Sat Dec 15 10:28:19 2007
@@ -18,6 +18,7 @@
 
 import java.io.IOException;
 import java.net.URL;
+import java.util.List;
 import java.util.Set;
 
 import javax.servlet.RequestDispatcher;
@@ -129,14 +130,14 @@
         PluginRepositoryList repos = ((PluginRepositoryList) kernel.getProxyManager().createProxy((AbstractName) installers.iterator().next(),
                 PluginRepositoryList.class));
 
-        URL[] urls = repos.getRepositories();
-        if(urls.length == 0) {
+        List<URL> urls = repos.getRepositories();
+        if(urls.isEmpty()) {
             repos.refresh();
             urls = repos.getRepositories();
-            if(urls.length == 0) {
+            if(urls.isEmpty()) {
                 throw new ServletException("Unable to install sample applicatoin; unable to download repository list");
             }
         }
-        return urls[0];
+        return urls.get(0);
     }
 }

Modified: geronimo/server/trunk/framework/configs/rmi-naming/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/rmi-naming/src/main/plan/plan.xml?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/rmi-naming/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/framework/configs/rmi-naming/src/main/plan/plan.xml Sat Dec 15 10:28:19 2007
@@ -89,6 +89,11 @@
                 <name>Jsr88</name>
             </pattern>
         </references>
+        <references name="PersistentConfigurationLists">
+            <pattern>
+                <name>AttributeManager</name>
+            </pattern>
+        </references>
     </gbean>
 
     <gbean name="DefaultServer" class="org.apache.geronimo.system.plugin.ReferenceServerInstanceData">

Modified: geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java Sat Dec 15 10:28:19 2007
@@ -56,6 +56,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.GBeanNotFoundException;
 import org.apache.geronimo.system.jmx.KernelDelegate;
 import org.apache.geronimo.system.plugin.DownloadPoller;
 import org.apache.geronimo.system.plugin.DownloadResults;
@@ -309,7 +310,7 @@
         for (AbstractName name : set) {
             PluginRepositoryList repo = (PluginRepositoryList) kernel.getProxyManager().createProxy(name,
                     PluginRepositoryList.class);
-            list.addAll(Arrays.asList(repo.getRepositories()));
+            list.addAll(repo.getRepositories());
             kernel.getProxyManager().destroyProxy(repo);
         }
         return list.toArray(new URL[list.size()]);

Modified: geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandListConfigurations.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandListConfigurations.java?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandListConfigurations.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandListConfigurations.java Sat Dec 15 10:28:19 2007
@@ -224,16 +224,6 @@
         DownloadResults results = CommandInstallCAR.showProgress(consoleReader, mgr, key);
         int time = (int) (System.currentTimeMillis() - start) / 1000;
         CommandInstallCAR.printResults(consoleReader, results, time);
-        if (results.isFinished() && !results.isFailed()) {
-            for (PluginType plugin : list.getPlugin()) {
-                for (PluginArtifactType targetInstance : plugin.getPluginArtifact()) {
-                    DeployUtils.println("Now starting " + PluginInstallerGBean.toArtifact(targetInstance.getModuleId()) + "...", 0, consoleReader);
-                    consoleReader.flushConsole();
-                    new CommandStart().execute(consoleReader, connection,
-                            new BaseCommandArgs(new String[]{PluginInstallerGBean.toArtifact(targetInstance.getModuleId()).toString()}));
-                }
-            }
-        }
     }
     
     public void assembleServer(GeronimoDeploymentManager mgr, PluginListType list, String repositoryPath, String relativeServerPath, ConsoleReader consoleReader) throws Exception {

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/AbstractNameQuery.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/AbstractNameQuery.java?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/AbstractNameQuery.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/AbstractNameQuery.java Sat Dec 15 10:28:19 2007
@@ -241,17 +241,22 @@
 
 
     public boolean matches(AbstractName info, Set targetInterfaceTypes) {
-        if (!info.getName().entrySet().containsAll(name.entrySet())) {
+        try {
+            if (!info.getName().entrySet().containsAll(name.entrySet())) {
+                return false;
+            }
+            if (!targetInterfaceTypes.containsAll(interfaceTypes)) {
+                return false;
+            }
+            if (artifact == null) {
+                return true;
+            }
+            Artifact otherArtifact = info.getArtifact();
+            return artifact.matches(otherArtifact);
+        } catch (NullPointerException e) {
+            e.printStackTrace();
             return false;
         }
-        if (!targetInterfaceTypes.containsAll(interfaceTypes)) {
-            return false;
-        }
-        if (artifact == null) {
-            return true;
-        }
-        Artifact otherArtifact = info.getArtifact();
-        return artifact.matches(otherArtifact);
     }
 
     /**

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationData.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationData.java?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationData.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationData.java Sat Dec 15 10:28:19 2007
@@ -21,10 +21,10 @@
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.LinkedHashMap;
 import java.util.Set;
 
 import org.apache.geronimo.gbean.GBeanData;
@@ -67,18 +67,18 @@
     /**
      * Child configurations of this configuration
      */
-    private final Map childConfigurations = new LinkedHashMap();
+    private final Map<Artifact, ConfigurationData> childConfigurations = new LinkedHashMap<Artifact, ConfigurationData>();
 
     /**
      * Configurations owned by this configuration.  This is only used for cascade-uninstall.
      */
-    private final Set ownedConfigurations = new LinkedHashSet();
+    private final Set<Artifact> ownedConfigurations = new LinkedHashSet<Artifact>();
 
     /**
      * The base file of the configuation
      */
     private transient File configurationDir;
-    
+
     /**
      * The base file of an in-place configuration
      */
@@ -123,7 +123,7 @@
         this(null, null, null, null, environment, null, null, naming);
     }
 
-    public ConfigurationData(ConfigurationModuleType moduleType, LinkedHashSet classPath, List gbeans, Map childConfigurations, Environment environment, File configurationDir, File inPlaceConfigurationDir, Naming naming) {
+    public ConfigurationData(ConfigurationModuleType moduleType, LinkedHashSet classPath, List gbeans, Map<Artifact, ConfigurationData> childConfigurations, Environment environment, File configurationDir, File inPlaceConfigurationDir, Naming naming) {
         if (naming == null) throw new NullPointerException("naming is null");
         this.naming = naming;
         if (moduleType != null) {
@@ -152,6 +152,7 @@
 
     /**
      * Gets the time at which this configuration was created (or deployed).
+     *
      * @return the time at which this configuration was created (or deployed)
      */
     public long getCreated() {
@@ -191,7 +192,7 @@
      * configurations (as in, a WAR within an EAR, not dependencies between
      * totally separate configurations).
      */
-    public Map getChildConfigurations() {
+    public Map<Artifact, ConfigurationData> getChildConfigurations() {
         return Collections.unmodifiableMap(childConfigurations);
     }
 
@@ -203,10 +204,10 @@
     /**
      * Gets the configurations owned by this configuration.  This is only used
      * for cascade-uninstall.
-     * 
+     *
      * @return the configurations owned by this configuration
      */
-    public Set getOwnedConfigurations() {
+    public Set<Artifact> getOwnedConfigurations() {
         return Collections.unmodifiableSet(ownedConfigurations);
     }
 
@@ -220,9 +221,9 @@
         return environment;
     }
 
-	public File getInPlaceConfigurationDir() {
-		return inPlaceConfigurationDir;
-	}
+    public File getInPlaceConfigurationDir() {
+        return inPlaceConfigurationDir;
+    }
 
     public File getConfigurationDir() {
         return configurationDir;

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java Sat Dec 15 10:28:19 2007
@@ -37,7 +37,7 @@
 
     void save() throws IOException;
 
-    List restore() throws IOException;
+    List<Artifact> restore() throws IOException;
 
     /**
      * Adds a configuration to the list, but does not mark it as started.

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/AbstractRepository.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/AbstractRepository.java?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/AbstractRepository.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/AbstractRepository.java Sat Dec 15 10:28:19 2007
@@ -51,7 +51,7 @@
     protected static final Log log = LogFactory.getLog(AbstractRepository.class);
     private final static ArtifactTypeHandler DEFAULT_TYPE_HANDLER = new CopyArtifactTypeHandler();
     protected final File rootFile;
-    private final Map typeHandlers = new HashMap();
+    private final Map<String, ArtifactTypeHandler> typeHandlers = new HashMap<String, ArtifactTypeHandler>();
 
     public AbstractRepository(File rootFile) {
         if (rootFile == null) throw new NullPointerException("root is null");
@@ -73,11 +73,11 @@
     }
 
     private static final String NAMESPACE = "http://geronimo.apache.org/xml/ns/deployment-1.2";
-    public LinkedHashSet getDependencies(Artifact artifact) {
+    public LinkedHashSet<Artifact> getDependencies(Artifact artifact) {
         if(!artifact.isResolved()) {
             throw new IllegalArgumentException("Artifact "+artifact+" is not fully resolved");
         }
-        LinkedHashSet dependencies = new LinkedHashSet();
+        LinkedHashSet<Artifact> dependencies = new LinkedHashSet<Artifact>();
         URL url;
         try {
             File location = getLocation(artifact);
@@ -203,7 +203,7 @@
             throw new IllegalArgumentException("Destination " + location.getAbsolutePath() + " already exists!");
         }
 
-        ArtifactTypeHandler typeHandler = (ArtifactTypeHandler) typeHandlers.get(destination.getType());
+        ArtifactTypeHandler typeHandler = typeHandlers.get(destination.getType());
         if (typeHandler == null) typeHandler = DEFAULT_TYPE_HANDLER;
         typeHandler.install(source, size, destination, monitor, location);
         

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Maven2Repository.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Maven2Repository.java?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Maven2Repository.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Maven2Repository.java Sat Dec 15 10:28:19 2007
@@ -187,11 +187,4 @@
         return artifacts;
     }
 
-    /**
-     * @deprecated
-     * @return
-     */
-    public String getRootPath() {
-        return rootFile.getPath();
-    }
 }

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Repository.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Repository.java?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Repository.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Repository.java Sat Dec 15 10:28:19 2007
@@ -58,5 +58,5 @@
      *         dependencies declared in META-INF/geronimo-dependency.xml for the
      *         specified artifact.
      */
-    LinkedHashSet getDependencies(Artifact artifact);
+    LinkedHashSet<Artifact> getDependencies(Artifact artifact);
 }

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/WritableListableRepository.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/WritableListableRepository.java?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/WritableListableRepository.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/WritableListableRepository.java Sat Dec 15 10:28:19 2007
@@ -20,9 +20,4 @@
  * @version $Rev$ $Date$
  */
 public interface WritableListableRepository extends WriteableRepository, ListableRepository {
-    /**
-     * @deprecated.  Please please don't use this temporary hack
-     * @return
-     */
-    String getRootPath();
 }

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockRepository.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockRepository.java?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockRepository.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockRepository.java Sat Dec 15 10:28:19 2007
@@ -60,8 +60,8 @@
         return new File(".");
     }
 
-    public LinkedHashSet getDependencies(Artifact artifact) {
-        return new LinkedHashSet();
+    public LinkedHashSet<Artifact> getDependencies(Artifact artifact) {
+        return new LinkedHashSet<Artifact>();
     }
 
     public SortedSet<Artifact> list() {

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockWritableListableRepository.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockWritableListableRepository.java?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockWritableListableRepository.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockWritableListableRepository.java Sat Dec 15 10:28:19 2007
@@ -38,11 +38,4 @@
     public void copyToRepository(InputStream source, int size, Artifact destination, FileWriteMonitor monitor) throws IOException {
     }
 
-    /**
-     * @deprecated remove as soon as possible && dont ever use
-     * @return
-     */
-    public String getRootPath() {
-        return null;
-    }
 }

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java Sat Dec 15 10:28:19 2007
@@ -416,7 +416,7 @@
         this.kernelFullyStarted = kernelFullyStarted;
     }
 
-    public synchronized List restore() throws IOException {
+    public synchronized List<Artifact> restore() throws IOException {
         List<Artifact> configs = new ArrayList<Artifact>();
         for (Map.Entry<Artifact, ConfigurationOverride> entry : serverOverride.getConfigurations().entrySet()) {
             ConfigurationOverride configuration = entry.getValue();

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java Sat Dec 15 10:28:19 2007
@@ -28,7 +28,6 @@
 import java.util.List;
 import java.util.SortedSet;
 import java.util.Set;
-import java.util.Collections;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipOutputStream;
@@ -48,7 +47,6 @@
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
 import org.apache.geronimo.kernel.config.IOUtil;
 import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.repository.FileWriteMonitor;
 import org.apache.geronimo.kernel.repository.WritableListableRepository;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -63,16 +61,18 @@
     private final static Log log = LogFactory.getLog(RepositoryConfigurationStore.class);
     private final Kernel kernel;
     private final ObjectName objectName;
+    private final AbstractName abstractName;
     protected final WritableListableRepository repository;
     private final InPlaceConfigurationUtil inPlaceConfUtil;
 
     public RepositoryConfigurationStore(WritableListableRepository repository) {
-        this(null, null, repository);
+        this(null, null, null, repository);
     }
 
-    public RepositoryConfigurationStore(Kernel kernel, String objectName, WritableListableRepository repository) {
+    public RepositoryConfigurationStore(Kernel kernel, String objectName, AbstractName abstractName, WritableListableRepository repository) {
         this.kernel = kernel;
         this.objectName = objectName == null ? null : ObjectNameUtil.getObjectName(objectName);
+        this.abstractName = abstractName;
         this.repository = repository;
 
         inPlaceConfUtil = new InPlaceConfigurationUtil();
@@ -83,7 +83,7 @@
     }
 
     public AbstractName getAbstractName() {
-        return kernel == null? null:kernel.getAbstractNameFor(this);
+        return abstractName;
     }
 
     public ConfigurationData loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
@@ -215,6 +215,7 @@
             try {
                 inPlaceLocation = inPlaceConfUtil.readInPlaceLocation(location);
             } catch (IOException e) {
+                //ignore
             }
             if (null != inPlaceLocation) {
                 location = inPlaceLocation;
@@ -268,8 +269,7 @@
 
     private void writeToZip(File dir, ZipOutputStream out, String prefix, byte[] buf) throws IOException {
         File[] all = dir.listFiles();
-        for (int i = 0; i < all.length; i++) {
-            File file = all[i];
+        for (File file : all) {
             if (file.isDirectory()) {
                 writeToZip(file, out, prefix + file.getName() + "/", buf);
             } else {
@@ -292,16 +292,6 @@
         }
     }
 
-    public void install(InputStream in, int size, Artifact configId, FileWriteMonitor fileWriteMonitor) throws IOException {
-        try {
-            repository.copyToRepository(in, size, configId, fileWriteMonitor);
-        } catch (IOException e) {
-            throw e;
-        } finally {
-            IOUtil.close(in);
-        }
-    }
-
     public boolean isInPlaceConfiguration(Artifact configId) throws NoSuchConfigException, IOException {
         if(!configId.isResolved()) {
             throw new IllegalArgumentException("Artifact "+configId+" is not fully resolved");
@@ -399,37 +389,35 @@
                         ioException = e;
                     }
                 }
-                if (ioException != null) {
-                    throw ioException;
-                }
+            }
+            if (ioException != null) {
+                throw ioException;
             }
         }
     }
 
     public List<ConfigurationInfo> listConfigurations() {
-        SortedSet artifacts = repository.list();
+        SortedSet<Artifact> artifacts = repository.list();
 
-        List configs;
+        List<ConfigurationInfo> configs= new ArrayList<ConfigurationInfo>();
         synchronized (this) {
-            configs = new ArrayList();
-            for (Iterator i = artifacts.iterator(); i.hasNext();) {
-                Artifact configId = (Artifact) i.next();
+            for (Artifact configId : artifacts) {
                 File dir = repository.getLocation(configId);
                 File meta = new File(dir, "META-INF");
-                if(!meta.isDirectory() || !meta.canRead()) {
+                if (!meta.isDirectory() || !meta.canRead()) {
                     continue;
                 }
                 File ser = new File(meta, "config.ser");
-                if(!ser.isFile() || !ser.canRead() || ser.length() == 0) {
+                if (!ser.isFile() || !ser.canRead() || ser.length() == 0) {
                     continue;
                 }
                 try {
                     ConfigurationInfo configurationInfo = loadConfigurationInfo(configId);
                     configs.add(configurationInfo);
                 } catch (NoSuchConfigException e) {
-                    log.error("Unexpected error: found META-INF/config.ser for "+configId+" but couldn't load ConfigurationInfo", e);
+                    log.error("Unexpected error: found META-INF/config.ser for " + configId + " but couldn't load ConfigurationInfo", e);
                 } catch (IOException e) {
-                    log.error("Unable to load ConfigurationInfo for "+configId, e);
+                    log.error("Unable to load ConfigurationInfo for " + configId, e);
                 }
             }
         }
@@ -551,8 +539,9 @@
         GBeanInfoBuilder builder = GBeanInfoBuilder.createStatic(RepositoryConfigurationStore.class, "ConfigurationStore");
         builder.addAttribute("kernel", Kernel.class, false);
         builder.addAttribute("objectName", String.class, false);
+        builder.addAttribute("abstractName", AbstractName.class, false);
         builder.addReference("Repository", WritableListableRepository.class, "Repository");
-        builder.setConstructor(new String[]{"kernel", "objectName", "Repository"});
+        builder.setConstructor(new String[]{"kernel", "objectName", "abstractName", "Repository"});
         GBEAN_INFO = builder.getBeanInfo();
     }
 }

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/SwitchableLocalAttributeManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/SwitchableLocalAttributeManager.java?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/SwitchableLocalAttributeManager.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/SwitchableLocalAttributeManager.java Sat Dec 15 10:28:19 2007
@@ -39,8 +39,8 @@
     }
 
     @Override
-    public synchronized List restore() throws IOException {
-        return Collections.EMPTY_LIST;
+    public synchronized List<Artifact> restore() throws IOException {
+        return Collections.emptyList();
     }
 
     public synchronized void setOnline(boolean online) {

Added: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/GeronimoSourceRepository.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/GeronimoSourceRepository.java?rev=604483&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/GeronimoSourceRepository.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/GeronimoSourceRepository.java Sat Dec 15 10:28:19 2007
@@ -0,0 +1,230 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.geronimo.system.plugin;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.SortedSet;
+import java.util.LinkedHashSet;
+import java.util.jar.JarFile;
+import java.util.zip.ZipEntry;
+
+import javax.security.auth.login.FailedLoginException;
+
+import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.config.NoSuchConfigException;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.FileWriteMonitor;
+import org.apache.geronimo.kernel.repository.ListableRepository;
+import org.apache.geronimo.kernel.repository.Repository;
+import org.apache.geronimo.kernel.repository.WritableListableRepository;
+import org.apache.geronimo.kernel.repository.WriteableRepository;
+import org.apache.geronimo.system.configuration.RepositoryConfigurationStore;
+import org.apache.geronimo.system.plugin.model.PluginListType;
+import org.apache.geronimo.system.plugin.model.PluginType;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class GeronimoSourceRepository implements SourceRepository {
+
+    private final Collection<? extends Repository> repos;
+
+    public GeronimoSourceRepository(Collection<? extends Repository> repos) {
+        this.repos = repos;
+    }
+
+    public PluginListType getPluginList() {
+        Map<PluginType, PluginType> pluginMap = new HashMap<PluginType, PluginType>();
+        for (Repository listableRepository : repos) {
+            if (listableRepository instanceof ListableRepository) {
+                SortedSet<Artifact> artifacts = ((ListableRepository) listableRepository).list();
+                for (Artifact artifact : artifacts) {
+                    File location = listableRepository.getLocation(artifact);
+                    PluginType data = extractPluginMetadata(location);
+                    if (data != null) {
+                        PluginType key = PluginInstallerGBean.toKey(data);
+                        PluginType existing = pluginMap.get(key);
+                        if (existing == null) {
+                            pluginMap.put(key, data);
+                        } else {
+                            existing.getPluginArtifact().addAll(data.getPluginArtifact());
+                        }
+                    }
+                }
+            }
+        }
+        PluginListType pluginList = new PluginListType();
+        pluginList.getPlugin().addAll(pluginMap.values());
+        return pluginList;
+    }
+
+    public OpenResult open(Artifact artifact, FileWriteMonitor monitor) throws IOException, FailedLoginException {
+        for (Repository repo: repos) {
+            if (repo.contains(artifact)) {
+                File location = repo.getLocation(artifact);
+                if (location.isFile()) {
+                    return new LocalOpenResult(artifact, location);
+                }
+                if (location.isDirectory()) {
+                    return new ZipOpenResult(artifact, repo);
+                }
+            }
+        }
+        return null;
+    }
+
+    PluginType extractPluginMetadata(Artifact artifact) {
+        for (Repository repo: repos) {
+            if (repo.contains(artifact)) {
+                File location = repo.getLocation(artifact);
+                return extractPluginMetadata(location);
+            }
+        }
+        return null;
+    }
+
+    static PluginType extractPluginMetadata(File dir) {
+        try {
+            if (dir.isDirectory()) {
+                File meta = new File(dir, "META-INF");
+                if (!meta.isDirectory() || !meta.canRead()) {
+                    return null;
+                }
+                File xml = new File(meta, "geronimo-plugin.xml");
+                if (!xml.isFile() || !xml.canRead() || xml.length() == 0) {
+                        return null;
+                }
+                InputStream in = new FileInputStream(xml);
+                try {
+                    return PluginXmlUtil.loadPluginMetadata(in);
+                } finally {
+                    in.close();
+                }
+            } else {
+                if (!dir.isFile() || !dir.canRead()) {
+                    throw new IllegalStateException("Cannot read configuration " + dir.getAbsolutePath());
+                }
+                JarFile jar = new JarFile(dir);
+                try {
+                    ZipEntry entry = jar.getEntry("META-INF/geronimo-plugin.xml");
+                    if (entry == null) {
+                            return null;
+                    }
+                    InputStream in = jar.getInputStream(entry);
+                    try {
+                        return PluginXmlUtil.loadPluginMetadata(in);
+                    } finally {
+                        in.close();
+                    }
+                } finally {
+                    jar.close();
+                }
+            }
+        } catch (Exception e) {
+            //ignore
+        }
+        return null;
+    }
+
+    private static class RepoWrapper implements WritableListableRepository {
+
+        private final Repository repo;
+
+        private RepoWrapper(Repository repo) {
+            this.repo = repo;
+        }
+
+        public void copyToRepository(File source, Artifact destination, FileWriteMonitor monitor) throws IOException {
+        }
+
+        public void copyToRepository(InputStream source, int size, Artifact destination, FileWriteMonitor monitor) throws IOException {
+        }
+
+        public boolean contains(Artifact artifact) {
+            return repo.contains(artifact);
+        }
+
+        public File getLocation(Artifact artifact) {
+            return repo.getLocation(artifact);
+        }
+
+        public LinkedHashSet<Artifact> getDependencies(Artifact artifact) {
+            return null;
+        }
+
+        public SortedSet<Artifact> list() {
+            return null;
+        }
+
+        public SortedSet<Artifact> list(Artifact query) {
+            return null;
+        }
+    }
+
+    private class ZipOpenResult implements OpenResult {
+        private final Artifact artifact;
+        private final Repository repo;
+        File location;
+
+        private ZipOpenResult(Artifact artifact, Repository repo) {
+            this.artifact = artifact;
+            this.repo = repo;
+        }
+
+        public Artifact getArtifact() {
+            return artifact;
+        }
+
+        public File getFile() throws IOException {
+            location = File.createTempFile("geronimo-plugin-download-", ".tmp");
+            OutputStream output = new FileOutputStream(location);
+            WritableListableRepository writableRepo = new RepoWrapper(repo);
+            ConfigurationStore store = new RepositoryConfigurationStore(writableRepo);
+            try {
+                store.exportConfiguration(artifact, output);
+            } catch (NoSuchConfigException e) {
+                throw (IOException)new IOException("Could not locate artefact " + artifact).initCause(e);
+            }
+
+            return location;
+        }
+
+        public void install(WriteableRepository repo, FileWriteMonitor monitor) throws IOException {
+            File file = getFile();
+            repo.copyToRepository(file, artifact, monitor);
+            if (!file.delete()) {
+//                log.warn("Unable to delete temporary download file " + tempFile.getAbsolutePath());
+                file.deleteOnExit();
+            }
+        }
+
+        public void close() {
+        }
+    }
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/GeronimoSourceRepository.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/GeronimoSourceRepository.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/GeronimoSourceRepository.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/LocalOpenResult.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/LocalOpenResult.java?rev=604483&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/LocalOpenResult.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/LocalOpenResult.java Sat Dec 15 10:28:19 2007
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.geronimo.system.plugin;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.FileWriteMonitor;
+import org.apache.geronimo.kernel.repository.WriteableRepository;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+class LocalOpenResult implements OpenResult {
+    private final Artifact artifact;
+    private final File file;
+
+    LocalOpenResult(Artifact artifact, File file) {
+        this.artifact = artifact;
+        this.file = file;
+    }
+
+    public Artifact getArtifact() {
+        return artifact;
+    }
+
+    public File getFile() {
+        return file;
+    }
+
+    public void install(WriteableRepository repo, FileWriteMonitor monitor) throws IOException {
+        repo.copyToRepository(file, artifact, monitor);
+    }
+
+    public void close() {
+    }
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/LocalOpenResult.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/LocalOpenResult.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/LocalOpenResult.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/LocalSourceRepository.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/LocalSourceRepository.java?rev=604483&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/LocalSourceRepository.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/LocalSourceRepository.java Sat Dec 15 10:28:19 2007
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.geronimo.system.plugin;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+
+import javax.security.auth.login.FailedLoginException;
+
+import org.apache.geronimo.kernel.repository.Artifact;
+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.FileWriteMonitor;
+import org.apache.geronimo.kernel.repository.Maven2Repository;
+import org.apache.geronimo.kernel.repository.MissingDependencyException;
+import org.apache.geronimo.system.plugin.model.PluginListType;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class LocalSourceRepository extends Maven2Repository implements SourceRepository {
+
+    private final ArtifactResolver artifactResolver;
+
+    public LocalSourceRepository(File base) {
+        super(base);
+        artifactResolver = new DefaultArtifactResolver(new DefaultArtifactManager(), this);
+    }
+
+    public PluginListType getPluginList() {
+        try {
+            FileInputStream in = new FileInputStream(new File(rootFile, "geronimo-plugins.xml"));
+            try {
+                return PluginXmlUtil.loadPluginList(in);
+            } finally {
+                in.close();
+            }
+        } catch (Exception e) {
+            return null;
+        }
+    }
+
+    public OpenResult open(Artifact artifact, FileWriteMonitor monitor) throws IOException, FailedLoginException {
+        if (!artifact.isResolved()) {
+            try {
+                artifact = artifactResolver.resolveInClassLoader(artifact);
+            } catch (MissingDependencyException e) {
+                throw (IOException)new IOException("Could not resolve artifact " + artifact + " in repo " + rootFile).initCause(e);
+            }
+        }
+        File location = getLocation(artifact);
+        return new LocalOpenResult(artifact, location);
+    }
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/LocalSourceRepository.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/LocalSourceRepository.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/LocalSourceRepository.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/OpenResult.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/OpenResult.java?rev=604483&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/OpenResult.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/OpenResult.java Sat Dec 15 10:28:19 2007
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.geronimo.system.plugin;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.WriteableRepository;
+import org.apache.geronimo.kernel.repository.FileWriteMonitor;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public interface OpenResult {
+    Artifact getArtifact();
+
+    File getFile() throws IOException;
+
+    void install(WriteableRepository repo, FileWriteMonitor monitor) throws IOException;
+
+    void close();
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/OpenResult.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/OpenResult.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/OpenResult.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message