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/08/01 22:32:18 UTC

svn commit: r427714 - in /geronimo/trunk: applications/console/console-standard/src/java/org/apache/geronimo/console/car/ modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ modules/system/src/java/org/apache/geronimo/system/plugin/

Author: ammulder
Date: Tue Aug  1 13:32:17 2006
New Revision: 427714

URL: http://svn.apache.org/viewvc?rev=427714&view=rev
Log:
Merge GERONIMO-2261 and GERONIMO-2243 to trunk

Modified:
    geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/AddRepositoryHandler.java
    geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ListHandler.java
    geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
    geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java

Modified: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/AddRepositoryHandler.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/AddRepositoryHandler.java?rev=427714&r1=427713&r2=427714&view=diff
==============================================================================
--- geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/AddRepositoryHandler.java (original)
+++ geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/AddRepositoryHandler.java Tue Aug  1 13:32:17 2006
@@ -16,12 +16,11 @@
  */
 package org.apache.geronimo.console.car;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.console.MultiPageModel;
 import org.apache.geronimo.console.util.PortletManager;
-import org.apache.geronimo.console.util.ConfigurationData;
 import org.apache.geronimo.system.plugin.PluginRepositoryList;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
@@ -30,14 +29,14 @@
 import javax.portlet.RenderResponse;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.FileNotFoundException;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.net.URL;
+import java.net.ConnectException;
 import java.net.HttpURLConnection;
 import java.net.MalformedURLException;
+import java.net.URL;
 import java.net.URLConnection;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * Handler for the import export main screen.
@@ -116,7 +115,12 @@
             URLConnection urlConnection = test.openConnection();
             if(urlConnection instanceof HttpURLConnection) {
                 HttpURLConnection con = (HttpURLConnection) urlConnection;
-                con.connect();
+                try {
+                    con.connect();
+                } catch (ConnectException e) {
+                    response.setRenderParameter("repoError", "Unable to connect to "+url+" ("+e.getMessage()+")");
+                    return false;
+                }
                 int result = con.getResponseCode();
                 log.debug("Repository check response: "+result);
                 if(result == 404) {

Modified: geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ListHandler.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ListHandler.java?rev=427714&r1=427713&r2=427714&view=diff
==============================================================================
--- geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ListHandler.java (original)
+++ geronimo/trunk/applications/console/console-standard/src/java/org/apache/geronimo/console/car/ListHandler.java Tue Aug  1 13:32:17 2006
@@ -67,7 +67,9 @@
         String repository = request.getParameter("repository");
         String user = request.getParameter("repo-user");
         String pass = request.getParameter("repo-pass");
-        loadFromRepository(request, repository, user, pass);
+        if(!loadFromRepository(request, repository, user, pass)) {
+            //todo: loading failed -- do something!
+        }
         request.setAttribute("repository", repository);
         request.setAttribute("repouser", user);
         request.setAttribute("repopass", pass);
@@ -77,7 +79,7 @@
         return getMode()+BEFORE_ACTION;
     }
 
-    private void loadFromRepository(RenderRequest request, String repository, String username, String password) throws IOException, PortletException {
+    private boolean loadFromRepository(RenderRequest request, String repository, String username, String password) throws IOException, PortletException {
         PluginList data;
         try {
             data = PortletManager.getCurrentServer(request).getPluginInstaller().listPlugins(new URL(repository), username, password);
@@ -85,6 +87,9 @@
             throw new PortletException("Invalid login for Maven repository '"+repository+"'", e);
         }
         Map results = new HashMap();
+        if(data == null || data.getPlugins() == null) {
+            return false;
+        }
         for (int i = 0; i < data.getPlugins().length; i++) {
             PluginMetadata metadata = data.getPlugins()[i];
             List values = (List) results.get(metadata.getCategory());
@@ -101,5 +106,6 @@
         }
         request.setAttribute("categories", results);
         request.getPortletSession(true).setAttribute(CONFIG_LIST_SESSION_KEY, data);
+        return true;
     }
 }

Modified: geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java?rev=427714&r1=427713&r2=427714&view=diff
==============================================================================
--- geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java (original)
+++ geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java Tue Aug  1 13:32:17 2006
@@ -22,6 +22,7 @@
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -29,18 +30,14 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.Arrays;
-
 import javax.naming.NamingException;
 import javax.naming.Reference;
 import javax.transaction.UserTransaction;
 import javax.xml.namespace.QName;
-
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.common.UnresolvedReferenceException;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.gbean.ReferencePatterns;
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.RefContext;
@@ -855,7 +852,6 @@
         return refMap;
     }
 
-    //TODO consider including target interface
     public static AbstractNameQuery buildAbstractNameQuery(GerPatternType pattern, String type, String moduleType, Set interfaceTypes) {
         String groupId = pattern.isSetGroupId() ? pattern.getGroupId().trim() : null;
         String artifactid = pattern.isSetArtifactId() ? pattern.getArtifactId().trim() : null;
@@ -871,6 +867,14 @@
         }
         if (module != null && moduleType != null) {
             nameMap.put(moduleType, module);
+        }
+        if(interfaceTypes != null) {
+            Set trimmed = new HashSet();
+            for (Iterator it = interfaceTypes.iterator(); it.hasNext();) {
+                String intf = (String) it.next();
+                trimmed.add(intf == null ? null : intf.trim());
+            }
+            interfaceTypes = trimmed;
         }
         return new AbstractNameQuery(artifact, nameMap, interfaceTypes);
     }

Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java?rev=427714&r1=427713&r2=427714&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java (original)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java Tue Aug  1 13:32:17 2006
@@ -1351,7 +1351,7 @@
         if (moduleId != null) {
             artifact = Artifact.create(moduleId);
             // Tests, etc. don't need to have a ConfigurationManager
-            installed = configManager != null && configManager.isLoaded(artifact);
+            installed = configManager != null && configManager.isInstalled(artifact);
         }
         log.trace("Checking "+moduleId+": installed="+installed+", eligible="+eligible);
         PluginMetadata data = new PluginMetadata(getChildText(plugin, "name"),