geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r604588 - in /geronimo/server/trunk: framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/ framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ framework/modules/geronimo-kernel/sr...
Date Sun, 16 Dec 2007 09:41:37 GMT
Author: djencks
Date: Sun Dec 16 01:41:36 2007
New Revision: 604588

URL: http://svn.apache.org/viewvc?rev=604588&view=rev
Log:
straighten out some genericity issues and old mistakes

Modified:
    geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.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/ConfigurationUtil.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationUtilTest.java
    geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/dependencyview/DependencyViewPortlet.java

Modified: geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java?rev=604588&r1=604587&r2=604588&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
Sun Dec 16 01:41:36 2007
@@ -516,7 +516,7 @@
             throw new DeploymentException(message.toString());
         }
 
-        ArrayList<GBeanData> gbeans = new ArrayList<GBeanData>(configuration.getGBeans().values());
+        List<GBeanData> gbeans = new ArrayList<GBeanData>(configuration.getGBeans().values());
         Collections.sort(gbeans, new GBeanData.PriorityComparator());
         ConfigurationData configurationData = new ConfigurationData(configuration.getModuleType(),
                 new LinkedHashSet<String>(configuration.getClassPath()),

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java?rev=604588&r1=604587&r2=604588&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
Sun Dec 16 01:41:36 2007
@@ -554,7 +554,7 @@
      * Gets the configurations owned by this configuration.  This is only used for cascade-uninstall.
      * @return the configurations owned by this configuration
      */
-    public Set<Configuration> getOwnedConfigurations() {
+    public Set<Artifact> getOwnedConfigurations() {
         return configurationData.getOwnedConfigurations();
     }
 

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=604588&r1=604587&r2=604588&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
Sun Dec 16 01:41:36 2007
@@ -57,7 +57,7 @@
     /**
      * List of URIs in this configuration's classpath.  These are for the classes directly
included in the configuration
      */
-    private final LinkedHashSet classPath = new LinkedHashSet();
+    private final LinkedHashSet<String> classPath = new LinkedHashSet<String>();
 
     /**
      * The gbeans contained in this configuration
@@ -67,7 +67,7 @@
     /**
      * Child configurations of this configuration
      */
-    private final Map<Artifact, ConfigurationData> childConfigurations = new LinkedHashMap<Artifact,
ConfigurationData>();
+    private final Map<String, ConfigurationData> childConfigurations = new LinkedHashMap<String,
ConfigurationData>();
 
     /**
      * Configurations owned by this configuration.  This is only used for cascade-uninstall.
@@ -123,7 +123,7 @@
         this(null, null, null, null, environment, null, null, naming);
     }
 
-    public ConfigurationData(ConfigurationModuleType moduleType, LinkedHashSet classPath,
List gbeans, Map<Artifact, ConfigurationData> childConfigurations, Environment environment,
File configurationDir, File inPlaceConfigurationDir, Naming naming) {
+    public ConfigurationData(ConfigurationModuleType moduleType, LinkedHashSet<String>
classPath, List<GBeanData> gbeans, Map<String, 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) {
@@ -188,17 +188,17 @@
     }
 
     /**
-     * Gets a map of Artifact (config ID) to ConfigurationData for nested
+     * Gets a map of module name to ConfigurationData for nested
      * configurations (as in, a WAR within an EAR, not dependencies between
      * totally separate configurations).
      */
-    public Map<Artifact, ConfigurationData> getChildConfigurations() {
+    public Map<String, ConfigurationData> getChildConfigurations() {
         return Collections.unmodifiableMap(childConfigurations);
     }
 
-    public void addChildConfiguration(ConfigurationData configurationData) {
+    public void addChildConfiguration(String moduleName, ConfigurationData configurationData)
{
         if (configurationData == null) throw new NullPointerException("configurationData
is null");
-        childConfigurations.put(configurationData.getId(), configurationData);
+        childConfigurations.put(moduleName, configurationData);
     }
 
     /**

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java?rev=604588&r1=604587&r2=604588&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
Sun Dec 16 01:41:36 2007
@@ -215,20 +215,19 @@
     public static void writeConfigInfo(PrintWriter writer, ConfigurationData configurationData)
{
         writeConfigInfo("", writer, configurationData);
     }
+    
     private static void writeConfigInfo(String prefix, PrintWriter writer, ConfigurationData
configurationData) {
         writer.println(prefix+"id=" + configurationData.getId());
         writer.println(prefix+"type=" + configurationData.getModuleType());
         writer.println(prefix+"created=" + configurationData.getCreated());
-        Set ownedConfigurations = configurationData.getOwnedConfigurations();
+        Set<Artifact> ownedConfigurations = configurationData.getOwnedConfigurations();
         int i = 0;
-        for (Iterator iterator = ownedConfigurations.iterator(); iterator.hasNext();) {
-            Artifact ownedConfiguration = (Artifact) iterator.next();
-            writer.println(prefix+"owned." + i++ + "=" + ownedConfiguration);
+        for (Artifact ownedConfiguration : ownedConfigurations) {
+            writer.println(prefix + "owned." + i++ + "=" + ownedConfiguration);
         }
         i = 0;
-        for (Iterator it = configurationData.getChildConfigurations().values().iterator();
it.hasNext(); i++) {
-            ConfigurationData data = (ConfigurationData) it.next();
-            writeConfigInfo("child."+i+".", writer, data);
+        for (ConfigurationData data : configurationData.getChildConfigurations().values())
{
+            writeConfigInfo("child." + i++ + ".", writer, data);
         }
         writer.flush();
     }
@@ -238,6 +237,7 @@
         properties.load(in);
         return readConfigurationInfo("", properties, storeName, inPlaceLocation);
     }
+
     private static ConfigurationInfo readConfigurationInfo(String prefix, Properties properties,
AbstractName storeName, File inPlaceLocation) throws IOException {
         String id = properties.getProperty(prefix+"id");
         Artifact configId = Artifact.create(id);

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationUtilTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationUtilTest.java?rev=604588&r1=604587&r2=604588&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationUtilTest.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationUtilTest.java
Sun Dec 16 01:41:36 2007
@@ -68,7 +68,7 @@
         List gbeans;
         gbeans = data.getGBeans(getClass().getClassLoader());
         assertEquals(configurationData.getId(), data.getId());
-        ConfigurationData data3 = (ConfigurationData) data.getChildConfigurations().get(artifact3);
+        ConfigurationData data3 = (ConfigurationData) data.getChildConfigurations().get("testmodule");
         gbeans = data3.getGBeans(getClass().getClassLoader());
         assertEquals(new QName("namespaceURI", "localPart"), ((GBeanData)gbeans.get(0)).getAttribute("someObject"));
     }
@@ -101,7 +101,7 @@
 
 
         ConfigurationData childConfigurationData = new ConfigurationData(artifact3, naming,
marshaler.newGBeanState(Collections.EMPTY_SET));
-        configurationData.addChildConfiguration(childConfigurationData);
+        configurationData.addChildConfiguration("testmodule", childConfigurationData);
         GBeanData childConfigurationGBean = childConfigurationData.addGBean("ChildConfigurationGBean",
MockGBean.getGBeanInfo());
         childConfigurationGBean.setAttribute("name", "foo");
         childConfigurationGBean.setAttribute("someObject", new QName("namespaceURI", "localPart"));

Modified: geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/dependencyview/DependencyViewPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/dependencyview/DependencyViewPortlet.java?rev=604588&r1=604587&r2=604588&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/dependencyview/DependencyViewPortlet.java
(original)
+++ geronimo/server/trunk/plugins/debugviews/debugviews-portlets/src/main/java/org/apache/geronimo/console/dependencyview/DependencyViewPortlet.java
Sun Dec 16 01:41:36 2007
@@ -18,21 +18,13 @@
 
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.SortedSet;
 
-import org.apache.geronimo.console.BasePortlet;
-import org.apache.geronimo.console.util.PortletManager;
-import org.apache.geronimo.console.util.StringTree;
-import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.kernel.repository.Artifact;
-
-import java.util.List;
-
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
 import javax.portlet.PortletConfig;
@@ -42,14 +34,17 @@
 import javax.portlet.RenderResponse;
 import javax.portlet.WindowState;
 
-import org.apache.geronimo.kernel.DependencyManager;
+import org.apache.geronimo.console.BasePortlet;
+import org.apache.geronimo.console.util.PortletManager;
+import org.apache.geronimo.console.util.StringTree;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationInfo;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
-import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.repository.ListableRepository;
-import org.apache.geronimo.kernel.util.ClassLoaderRegistry;
+import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.ListableRepository;
 
 public class DependencyViewPortlet extends BasePortlet {
@@ -215,8 +210,7 @@
 
                 addDependencies(curr, conf);
 
-                if (info.getType().getValue() == ConfigurationModuleType.EAR
-                        .getValue()) {
+                if (info.getType().getValue() == ConfigurationModuleType.EAR.getValue())
{
                     StringTree nodeEJB = new StringTree("EJBModule");
                     curr.addChild(nodeEJB);
 
@@ -229,17 +223,12 @@
                     StringTree nodeCLI = new StringTree("AppClientModule");
                     curr.addChild(nodeCLI);
 
-                    Map query = new HashMap();
+                    Map<String, String> query = new HashMap<String, String>();
                     query.put("j2eeType", "EJBModule");
                     query.put("J2EEApplication", info.getConfigID().toString());
-                    Set setEnt = kernel
-                            .listGBeans(new org.apache.geronimo.gbean.AbstractNameQuery(
-                                    null, query));
-                    Iterator iterator = setEnt.iterator();
-                    while (iterator.hasNext()) {
-                        AbstractName gb = (AbstractName) iterator.next();
-                        StringTree subCurr = new StringTree(info.getConfigID()
-                                .getGroupId()
+                    Set<AbstractName> setEnt = kernel.listGBeans(new AbstractNameQuery(null,
query));
+                    for (AbstractName gb : setEnt) {
+                        StringTree subCurr = new StringTree(info.getConfigID().getGroupId()
                                 + "/"
                                 + info.getConfigID().getArtifactId()
                                 + "_"
@@ -253,20 +242,13 @@
                                 .getConfiguration(gb.getArtifact()));
                     }
 
-                    Map query1 = new HashMap();
+                    Map<String, String> query1 = new HashMap<String, String>();
                     query1.put("j2eeType", "ResourceAdapterModule");
-                    query1
-                            .put("J2EEApplication", info.getConfigID()
-                                    .toString());
-                    Set setEnt1 = kernel
-                            .listGBeans(new org.apache.geronimo.gbean.AbstractNameQuery(
-                                    null, query1));
-
-                    Iterator iterator1 = setEnt1.iterator();
-                    while (iterator1.hasNext()) {
-                        AbstractName gb = (AbstractName) iterator1.next();
-                        StringTree subCurr = new StringTree(info.getConfigID()
-                                .getGroupId()
+                    query1.put("J2EEApplication", info.getConfigID().toString());
+                    Set<AbstractName> setEnt1 = kernel.listGBeans(new AbstractNameQuery(null,
query1));
+
+                    for (AbstractName gb : setEnt1) {
+                        StringTree subCurr = new StringTree(info.getConfigID().getGroupId()
                                 + "/"
                                 + info.getConfigID().getArtifactId()
                                 + "_"
@@ -276,26 +258,19 @@
                                 + "/"
                                 + info.getConfigID().getType());
                         nodeRAR.addChild(subCurr);
-                        addDependencies(subCurr, configManager
-                                .getConfiguration(gb.getArtifact()));
+                        addDependencies(subCurr, configManager.getConfiguration(gb.getArtifact()));
                     }
 
-                    for (int i = 0; i < conf.getChildren().size(); i++) {
-                        Configuration config = ((Configuration) conf
-                                .getChildren().get(i));
-                        StringTree subCurr = new StringTree(config
-                                .getAbstractName().toString());
+                    for (Configuration config: conf.getChildren()) {
+                        StringTree subCurr = new StringTree(config.getAbstractName().toString());
                         nodeWeb.addChild(subCurr);
                         addDependencies(subCurr, config);
                     }
 
-                    for (Iterator iter = conf.getOwnedConfigurations()
-                            .iterator(); iter.hasNext();) {
-                        Artifact name = (Artifact) iter.next();
+                    for (Artifact name : conf.getOwnedConfigurations()) {
                         StringTree subCurr = new StringTree(name.toString());
                         nodeCLI.addChild(subCurr);
-                        addDependencies(subCurr, configManager
-                                .getConfiguration(name));
+                        addDependencies(subCurr, configManager.getConfiguration(name));
                     }
 
                 }



Mime
View raw message