You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by am...@apache.org on 2006/04/22 04:26:37 UTC

svn commit: r396059 - /geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java

Author: ammulder
Date: Fri Apr 21 19:26:36 2006
New Revision: 396059

URL: http://svn.apache.org/viewcvs?rev=396059&view=rev
Log:
Only return configurations (not JARs) from getInstalled() to be
  consistent with other is/get methods

Modified:
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java?rev=396059&r1=396058&r2=396059&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java Fri Apr 21 19:26:36 2006
@@ -61,7 +61,6 @@
         this.repositories = repositories;
     }
 
-
     public synchronized boolean isInstalled(Artifact configId) {
         if(!configId.isResolved()) {
             throw new IllegalArgumentException("Artifact "+configId+" is not fully resolved");
@@ -91,7 +90,18 @@
     }
 
     public Artifact[] getInstalled(Artifact query) {
-        return artifactResolver.queryArtifacts(query);
+        Artifact[] all = artifactResolver.queryArtifacts(query);
+        List configs = new ArrayList();
+        for (int i = 0; i < all.length; i++) {
+            Artifact artifact = all[i];
+            if(isConfiguration(artifact)) {
+                configs.add(artifact);
+            }
+        }
+        if(configs.size() == all.length) {
+            return all;
+        }
+        return (Artifact[]) configs.toArray(new Artifact[configs.size()]);
     }
 
     public Artifact[] getLoaded(Artifact query) {