geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r396059 - /geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
Date Sat, 22 Apr 2006 02:26:37 GMT
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) {



Mime
View raw message