geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r747165 [1/2] - in /geronimo/server/trunk: framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/ framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ framework/modules/geronimo-ker...
Date Mon, 23 Feb 2009 22:27:40 GMT
Author: djencks
Date: Mon Feb 23 22:27:34 2009
New Revision: 747165

URL: http://svn.apache.org/viewvc?rev=747165&view=rev
Log:
GERONIMO-4293 A lot more generics updates in kernel

Modified:
    geronimo/server/trunk/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.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/ConfigurationModel.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationStatus.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/GBeanState.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/LifecycleResults.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SerializedGBeanState.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/xstream/XStreamGBeanState.java
    geronimo/server/trunk/plugins/cxf/geronimo-cxf-tools/src/main/java/org/apache/geronimo/cxf/tools/JAXWSToolsCLI.java

Modified: geronimo/server/trunk/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java?rev=747165&r1=747164&r2=747165&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java Mon Feb 23 22:27:34 2009
@@ -18,43 +18,31 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.io.OutputStream;
-import java.net.MalformedURLException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
-import java.util.Set;
-import java.util.LinkedHashSet;
 import java.util.jar.JarFile;
 
 import junit.framework.TestCase;
 import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.kernel.Jsr77Naming;
-import org.apache.geronimo.kernel.mock.MockConfigStore;
 import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.config.ConfigurationAlreadyExistsException;
 import org.apache.geronimo.kernel.config.ConfigurationData;
-import org.apache.geronimo.kernel.config.ConfigurationManager;
+import org.apache.geronimo.kernel.config.ConfigurationInfo;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationResolver;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
-import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.config.LifecycleException;
-import org.apache.geronimo.kernel.config.LifecycleMonitor;
 import org.apache.geronimo.kernel.config.LifecycleResults;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
-import org.apache.geronimo.kernel.config.NoSuchStoreException;
 import org.apache.geronimo.kernel.config.SimpleConfigurationManager;
-import org.apache.geronimo.kernel.config.ConfigurationInfo;
+import org.apache.geronimo.kernel.mock.MockConfigStore;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.ArtifactResolver;
 import org.apache.geronimo.kernel.repository.DefaultArtifactResolver;
 import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.kernel.repository.Version;
 import org.apache.geronimo.kernel.repository.Repository;
-import org.apache.geronimo.kernel.repository.MissingDependencyException;
 
 
 /**
@@ -276,7 +264,7 @@
                     null,
                     ConfigurationModuleType.CAR,
                     new Jsr77Naming(),
-                    new SimpleConfigurationManager(Collections.singletonList(store), artifactResolver, Collections.EMPTY_SET));
+                    new SimpleConfigurationManager(Collections.<ConfigurationStore>singletonList(store), artifactResolver, Collections.<Repository>emptySet()));
         }
     }
 

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=747165&r1=747164&r2=747165&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 Mon Feb 23 22:27:34 2009
@@ -168,11 +168,11 @@
         return moduleType;
     }
 
-    public List getClassPath() {
-        return Collections.unmodifiableList(new ArrayList(classPath));
+    public List<String> getClassPath() {
+        return Collections.unmodifiableList(new ArrayList<String>(classPath));
     }
 
-    public List getGBeans(ClassLoader classLoader) throws InvalidConfigException {
+    public List<GBeanData> getGBeans(ClassLoader classLoader) throws InvalidConfigException {
         if (classLoader == null) throw new NullPointerException("classLoader is null");
         List<GBeanData> gbeans = gbeanState.getGBeans(classLoader);
         if (null == configurationDataTransformer) {
@@ -200,6 +200,7 @@
      * Gets a map of module name to ConfigurationData for nested
      * configurations (as in, a WAR within an EAR, not dependencies between
      * totally separate configurations).
+     * @return map of child configuration name to ConfigurationData for that child
      */
     public Map<String, ConfigurationData> getChildConfigurations() {
         return Collections.unmodifiableMap(childConfigurations);

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationModel.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationModel.java?rev=747165&r1=747164&r2=747165&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationModel.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationModel.java Mon Feb 23 22:27:34 2009
@@ -16,13 +16,12 @@
  */
 package org.apache.geronimo.kernel.config;
 
-import java.util.Iterator;
+import java.util.ArrayList;
 import java.util.LinkedHashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeMap;
-import java.util.List;
-import java.util.ArrayList;
 
 import org.apache.geronimo.kernel.repository.Artifact;
 
@@ -30,24 +29,23 @@
  * @version $Rev$ $Date$
  */
 public class ConfigurationModel {
-    private final Map configurations = new TreeMap();
+    private final Map<Artifact, ConfigurationStatus> configurations = new TreeMap<Artifact, ConfigurationStatus>();
 
-    public void addConfiguation(Artifact configurationId, Set loadParentIds, Set startParentIds) throws NoSuchConfigException {
-        Set startParents = getStatuses(startParentIds);
+    public void addConfiguation(Artifact configurationId, Set<Artifact> loadParentIds, Set<Artifact> startParentIds) throws NoSuchConfigException {
+        Set<ConfigurationStatus> startParents = getStatuses(startParentIds);
 
         // load parents are a superset of start parents
-        Set loadParents = new LinkedHashSet(startParents);
+        Set<ConfigurationStatus> loadParents = new LinkedHashSet<ConfigurationStatus>(startParents);
         loadParents.addAll(getStatuses(loadParentIds));
 
         ConfigurationStatus configurationStatus = new ConfigurationStatus(configurationId, loadParents, startParents);
         configurations.put(configurationId, configurationStatus);
     }
 
-    private Set getStatuses(Set configurationIds) throws NoSuchConfigException {
-        LinkedHashSet statuses = new LinkedHashSet(configurationIds.size());
-        for (Iterator iterator = configurationIds.iterator(); iterator.hasNext();) {
-            Artifact configurationId = (Artifact) iterator.next();
-            ConfigurationStatus configurationStatus = (ConfigurationStatus) configurations.get(configurationId);
+    private Set<ConfigurationStatus> getStatuses(Set<Artifact> configurationIds) throws NoSuchConfigException {
+        LinkedHashSet<ConfigurationStatus> statuses = new LinkedHashSet<ConfigurationStatus>(configurationIds.size());
+        for (Artifact configurationId : configurationIds) {
+            ConfigurationStatus configurationStatus = configurations.get(configurationId);
             if (configurationStatus == null) {
                 throw new NoSuchConfigException(configurationId);
             }
@@ -58,7 +56,7 @@
     }
 
     public void removeConfiguration(Artifact configurationId) throws NoSuchConfigException {
-        ConfigurationStatus configurationStatus = (ConfigurationStatus) configurations.get(configurationId);
+        ConfigurationStatus configurationStatus = configurations.get(configurationId);
         if (configurationStatus == null) {
             throw new NoSuchConfigException(configurationId);
         }
@@ -70,14 +68,14 @@
         return configurations.containsKey(configurationId);
     }
 
-    public void upgradeConfiguration(Artifact existingId, Artifact newId, Set newLoadParentIds, Set newStartParentIds) throws NoSuchConfigException {
-        Set newStartParents = getStatuses(newStartParentIds);
+    public void upgradeConfiguration(Artifact existingId, Artifact newId, Set<Artifact> newLoadParentIds, Set<Artifact> newStartParentIds) throws NoSuchConfigException {
+        Set<ConfigurationStatus> newStartParents = getStatuses(newStartParentIds);
 
         // load parents are a superset of start parents
-        Set newLoadParents = new LinkedHashSet(newStartParents);
+        Set<ConfigurationStatus> newLoadParents = new LinkedHashSet<ConfigurationStatus>(newStartParents);
         newLoadParents.addAll(getStatuses(newLoadParentIds));
 
-        ConfigurationStatus configurationStatus = (ConfigurationStatus) configurations.remove(existingId);
+        ConfigurationStatus configurationStatus = configurations.remove(existingId);
         if (configurationStatus == null) {
             throw new NoSuchConfigException(existingId);
         }
@@ -86,7 +84,7 @@
     }
 
     public boolean isLoaded(Artifact configurationId) {
-        ConfigurationStatus configurationStatus = (ConfigurationStatus) configurations.get(configurationId);
+        ConfigurationStatus configurationStatus = configurations.get(configurationId);
         if (configurationStatus != null) {
             return configurationStatus.isLoaded();
         }
@@ -94,20 +92,19 @@
     }
 
     public Artifact[] getLoaded(Artifact query) {
-        List results = new ArrayList();
-        for (Iterator it = configurations.entrySet().iterator(); it.hasNext();) {
-            Map.Entry entry = (Map.Entry) it.next();
-            Artifact test = (Artifact) entry.getKey();
-            ConfigurationStatus status = (ConfigurationStatus) entry.getValue();
-            if(query.matches(test) && status.isLoaded()) {
+        List<Artifact> results = new ArrayList<Artifact>();
+        for (Map.Entry<Artifact, ConfigurationStatus> entry : configurations.entrySet()) {
+            Artifact test = entry.getKey();
+            ConfigurationStatus status = entry.getValue();
+            if (query.matches(test) && status.isLoaded()) {
                 results.add(test);
             }
         }
-        return (Artifact[]) results.toArray(new Artifact[results.size()]);
+        return results.toArray(new Artifact[results.size()]);
     }
 
     public boolean isStarted(Artifact configurationId) {
-        ConfigurationStatus configurationStatus = (ConfigurationStatus) configurations.get(configurationId);
+        ConfigurationStatus configurationStatus = configurations.get(configurationId);
         if (configurationStatus != null) {
             return configurationStatus.isStarted();
         }
@@ -115,78 +112,76 @@
     }
 
     public Artifact[] getStarted(Artifact query) {
-        List results = new ArrayList();
-        for (Iterator it = configurations.entrySet().iterator(); it.hasNext();) {
-            Map.Entry entry = (Map.Entry) it.next();
-            Artifact test = (Artifact) entry.getKey();
-            ConfigurationStatus status = (ConfigurationStatus) entry.getValue();
-            if(query.matches(test) && status.isStarted()) {
+        List<Artifact> results = new ArrayList<Artifact>();
+        for (Map.Entry<Artifact, ConfigurationStatus> entry : configurations.entrySet()) {
+            Artifact test = entry.getKey();
+            ConfigurationStatus status = entry.getValue();
+            if (query.matches(test) && status.isStarted()) {
                 results.add(test);
             }
         }
-        return (Artifact[]) results.toArray(new Artifact[results.size()]);
+        return results.toArray(new Artifact[results.size()]);
     }
 
     public LinkedHashSet load(Artifact configurationId) throws NoSuchConfigException {
-        ConfigurationStatus configurationStatus = (ConfigurationStatus) configurations.get(configurationId);
+        ConfigurationStatus configurationStatus = configurations.get(configurationId);
         if (configurationStatus == null) {
             throw new NoSuchConfigException(configurationId);
         }
         return configurationStatus.load();
     }
 
-    public LinkedHashSet start(Artifact configurationId) throws NoSuchConfigException {
-        ConfigurationStatus configurationStatus = (ConfigurationStatus) configurations.get(configurationId);
+    public LinkedHashSet<Artifact> start(Artifact configurationId) throws NoSuchConfigException {
+        ConfigurationStatus configurationStatus = configurations.get(configurationId);
         if (configurationStatus == null) {
             throw new NoSuchConfigException(configurationId);
         }
         return configurationStatus.start();
     }
 
-    public LinkedHashSet stop(Artifact configurationId) throws NoSuchConfigException {
+    public LinkedHashSet<Artifact> stop(Artifact configurationId) throws NoSuchConfigException {
         return stop(configurationId, true);
     }
 
-    public LinkedHashSet stop(Artifact configurationId, boolean gc) throws NoSuchConfigException {
-        ConfigurationStatus configurationStatus = (ConfigurationStatus) configurations.get(configurationId);
+    public LinkedHashSet<Artifact> stop(Artifact configurationId, boolean gc) throws NoSuchConfigException {
+        ConfigurationStatus configurationStatus = configurations.get(configurationId);
         if (configurationStatus == null) {
             throw new NoSuchConfigException(configurationId);
         }
         return configurationStatus.stop(gc);
     }
 
-    public LinkedHashSet restart(Artifact configurationId) throws NoSuchConfigException {
-        ConfigurationStatus configurationStatus = (ConfigurationStatus) configurations.get(configurationId);
+    public LinkedHashSet<Artifact> restart(Artifact configurationId) throws NoSuchConfigException {
+        ConfigurationStatus configurationStatus = configurations.get(configurationId);
         if (configurationStatus == null) {
             throw new NoSuchConfigException(configurationId);
         }
         return configurationStatus.restart();
     }
 
-    public LinkedHashSet unload(Artifact configurationId) throws NoSuchConfigException {
+    public LinkedHashSet<Artifact> unload(Artifact configurationId) throws NoSuchConfigException {
         return unload(configurationId, true);
     }
 
-    public LinkedHashSet unload(Artifact configurationId, boolean gc) throws NoSuchConfigException {
-        ConfigurationStatus configurationStatus = (ConfigurationStatus) configurations.get(configurationId);
+    public LinkedHashSet<Artifact> unload(Artifact configurationId, boolean gc) throws NoSuchConfigException {
+        ConfigurationStatus configurationStatus = configurations.get(configurationId);
         if (configurationStatus == null) {
             throw new NoSuchConfigException(configurationId);
         }
         return configurationStatus.unload(gc);
     }
 
-    public LinkedHashSet reload(Artifact existingConfigurationId) throws NoSuchConfigException {
-        ConfigurationStatus configurationStatus = (ConfigurationStatus) configurations.get(existingConfigurationId);
+    public LinkedHashSet<Artifact> reload(Artifact existingConfigurationId) throws NoSuchConfigException {
+        ConfigurationStatus configurationStatus = configurations.get(existingConfigurationId);
         if (configurationStatus == null) {
-            return new LinkedHashSet();
+            return new LinkedHashSet<Artifact>();
         }
         return configurationStatus.reload();
     }
 
-    public Set getLoaded() {
-        Set result = new LinkedHashSet();
-        for (Iterator iterator = configurations.values().iterator(); iterator.hasNext();) {
-            ConfigurationStatus status = (ConfigurationStatus) iterator.next();
+    public Set<Artifact> getLoaded() {
+        Set<Artifact> result = new LinkedHashSet<Artifact>();
+        for (ConfigurationStatus status : configurations.values()) {
             if (status.isLoaded()) {
                 result.add(status.getConfigurationId());
             }
@@ -194,10 +189,9 @@
         return result;
     }
 
-    public Set getStarted() {
-        Set result = new LinkedHashSet();
-        for (Iterator iterator = configurations.values().iterator(); iterator.hasNext();) {
-            ConfigurationStatus status = (ConfigurationStatus) iterator.next();
+    public Set<Artifact> getStarted() {
+        Set<Artifact> result = new LinkedHashSet<Artifact>();
+        for (ConfigurationStatus status : configurations.values()) {
             if (status.isStarted()) {
                 result.add(status.getConfigurationId());
             }
@@ -205,10 +199,9 @@
         return result;
     }
 
-    public Set getUserLoaded() {
-        Set result = new LinkedHashSet();
-        for (Iterator iterator = configurations.values().iterator(); iterator.hasNext();) {
-            ConfigurationStatus status = (ConfigurationStatus) iterator.next();
+    public Set<Artifact> getUserLoaded() {
+        Set<Artifact> result = new LinkedHashSet<Artifact>();
+        for (ConfigurationStatus status : configurations.values()) {
             if (status.isUserLoaded()) {
                 result.add(status.getConfigurationId());
             }
@@ -216,10 +209,9 @@
         return result;
     }
 
-    public Set getUserStarted() {
-        Set result = new LinkedHashSet();
-        for (Iterator iterator = configurations.values().iterator(); iterator.hasNext();) {
-            ConfigurationStatus status = (ConfigurationStatus) iterator.next();
+    public Set<Artifact> getUserStarted() {
+        Set<Artifact> result = new LinkedHashSet<Artifact>();
+        for (ConfigurationStatus status : configurations.values()) {
             if (status.isUserStarted()) {
                 result.add(status.getConfigurationId());
             }
@@ -227,10 +219,10 @@
         return result;
     }
     
-    public LinkedHashSet getStartedChildren(Artifact configurationId) {
-        ConfigurationStatus configurationStatus = (ConfigurationStatus) configurations.get(configurationId);
+    public LinkedHashSet<Artifact> getStartedChildren(Artifact configurationId) {
+        ConfigurationStatus configurationStatus = configurations.get(configurationId);
         if (configurationStatus == null) {
-            return new LinkedHashSet();
+            return new LinkedHashSet<Artifact>();
         }
         return configurationStatus.getStartedChildren();
     }

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationStatus.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationStatus.java?rev=747165&r1=747164&r2=747165&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationStatus.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationStatus.java Mon Feb 23 22:27:34 2009
@@ -17,7 +17,6 @@
 package org.apache.geronimo.kernel.config;
 
 import java.util.LinkedHashSet;
-import java.util.Iterator;
 import java.util.Set;
 
 import org.apache.geronimo.kernel.repository.Artifact;
@@ -27,16 +26,16 @@
  */
 public class ConfigurationStatus {
     private Artifact configurationId;
-    private final Set loadParents = new LinkedHashSet();
-    private final Set startParents = new LinkedHashSet();
-    private final LinkedHashSet loadChildren = new LinkedHashSet();
-    private final LinkedHashSet startChildren = new LinkedHashSet();
+    private final Set<ConfigurationStatus> loadParents = new LinkedHashSet<ConfigurationStatus>();
+    private final Set<ConfigurationStatus> startParents = new LinkedHashSet<ConfigurationStatus>();
+    private final LinkedHashSet<ConfigurationStatus> loadChildren = new LinkedHashSet<ConfigurationStatus>();
+    private final LinkedHashSet<ConfigurationStatus> startChildren = new LinkedHashSet<ConfigurationStatus>();
     private boolean loaded = false;
     private boolean started = false;
     private boolean userLoaded = false;
     private boolean userStarted = false;
 
-    public ConfigurationStatus(Artifact configId, Set loadParents, Set startParents) {
+    public ConfigurationStatus(Artifact configId, Set<ConfigurationStatus> loadParents, Set<ConfigurationStatus> startParents) {
         if (configId == null) throw new NullPointerException("configId is null");
         if (loadParents == null) throw new NullPointerException("loadParents is null");
         if (startParents == null) throw new NullPointerException("startParents is null");
@@ -47,13 +46,11 @@
         this.loadParents.addAll(loadParents);
         this.startParents.addAll(startParents);
 
-        for (Iterator iterator = loadParents.iterator(); iterator.hasNext();) {
-            ConfigurationStatus loadParent = (ConfigurationStatus) iterator.next();
+        for (ConfigurationStatus loadParent : loadParents) {
             loadParent.loadChildren.add(this);
         }
 
-        for (Iterator iterator = startParents.iterator(); iterator.hasNext();) {
-            ConfigurationStatus startParent = (ConfigurationStatus) iterator.next();
+        for (ConfigurationStatus startParent : startParents) {
             startParent.startChildren.add(this);
         }
     }
@@ -69,14 +66,12 @@
             throw new IllegalStateException("Configuration " + configurationId + " still has children");
         }
 
-        for (Iterator iterator = loadParents.iterator(); iterator.hasNext();) {
-            ConfigurationStatus loadParent = (ConfigurationStatus) iterator.next();
+        for (ConfigurationStatus loadParent : loadParents) {
             loadParent.loadChildren.remove(this);
         }
         loadParents.clear();
 
-        for (Iterator iterator = startParents.iterator(); iterator.hasNext();) {
-            ConfigurationStatus startParent = (ConfigurationStatus) iterator.next();
+        for (ConfigurationStatus startParent : startParents) {
             startParent.startChildren.remove(this);
         }
         startChildren.clear();
@@ -86,28 +81,26 @@
         return configurationId;
     }
     
-    public LinkedHashSet getStartedChildren() {
-        LinkedHashSet childrenStatuses = new LinkedHashSet();
+    public LinkedHashSet<Artifact> getStartedChildren() {
+        LinkedHashSet<ConfigurationStatus> childrenStatuses = new LinkedHashSet<ConfigurationStatus>();
         getStartedChildrenInternal(childrenStatuses);
 
-        LinkedHashSet childrenIds = new LinkedHashSet(childrenStatuses.size());
-        for (Iterator iterator = childrenStatuses.iterator(); iterator.hasNext();) {
-            ConfigurationStatus configurationStatus = (ConfigurationStatus) iterator.next();
+        LinkedHashSet<Artifact> childrenIds = new LinkedHashSet<Artifact>(childrenStatuses.size());
+        for (ConfigurationStatus configurationStatus : childrenStatuses) {
             childrenIds.add(configurationStatus.configurationId);
         }
 
         return childrenIds;
     }
 
-    private void getStartedChildrenInternal(LinkedHashSet childrenStatuses) {
+    private void getStartedChildrenInternal(LinkedHashSet<ConfigurationStatus> childrenStatuses) {
         // if we aren't started, there is nothing to do
         if (!started) {
             return;
         }
 
         // visit all children
-        for (Iterator iterator = startChildren.iterator(); iterator.hasNext();) {
-            ConfigurationStatus child = (ConfigurationStatus) iterator.next();
+        for (ConfigurationStatus child : startChildren) {
             if (child.isStarted() && !child.configurationId.equals(configurationId)) {
                 child.getStartedChildrenInternal(childrenStatuses);
             }
@@ -132,20 +125,18 @@
     }
 
 
-    public void upgrade(Artifact newId, Set newLoadParents, Set newStartParents) {
+    public void upgrade(Artifact newId, Set<ConfigurationStatus> newLoadParents, Set<ConfigurationStatus> newStartParents) {
         this.configurationId = newId;
 
         //
         // remove links from the current parents to me
         //
-        for (Iterator iterator = loadParents.iterator(); iterator.hasNext();) {
-            ConfigurationStatus loadParent = (ConfigurationStatus) iterator.next();
+        for (ConfigurationStatus loadParent : loadParents) {
             loadParent.loadChildren.remove(this);
         }
         loadParents.clear();
 
-        for (Iterator iterator = startParents.iterator(); iterator.hasNext();) {
-            ConfigurationStatus startParent = (ConfigurationStatus) iterator.next();
+        for (ConfigurationStatus startParent : startParents) {
             startParent.startChildren.remove(this);
         }
         startChildren.clear();
@@ -156,28 +147,25 @@
         this.loadParents.addAll(newLoadParents);
         this.startParents.addAll(newStartParents);
 
-        for (Iterator iterator = loadParents.iterator(); iterator.hasNext();) {
-            ConfigurationStatus loadParent = (ConfigurationStatus) iterator.next();
+        for (ConfigurationStatus loadParent : loadParents) {
             loadParent.loadChildren.add(this);
         }
 
-        for (Iterator iterator = startParents.iterator(); iterator.hasNext();) {
-            ConfigurationStatus startParent = (ConfigurationStatus) iterator.next();
+        for (ConfigurationStatus startParent : startParents) {
             startParent.startChildren.add(this);
         }
     }
 
-    public LinkedHashSet load() {
-        LinkedHashSet loadList = new LinkedHashSet();
+    public LinkedHashSet<Artifact> load() {
+        LinkedHashSet<Artifact> loadList = new LinkedHashSet<Artifact>();
         loadInternal(loadList);
         userLoaded = true;
         return loadList;
     }
 
-    private void loadInternal(LinkedHashSet loadList) {
+    private void loadInternal(LinkedHashSet<Artifact> loadList) {
         // visit all unloaded parents
-        for (Iterator iterator = loadParents.iterator(); iterator.hasNext();) {
-            ConfigurationStatus parent = (ConfigurationStatus) iterator.next();
+        for (ConfigurationStatus parent : loadParents) {
             if (!parent.isLoaded()) {
                 parent.loadInternal(loadList);
             }
@@ -190,21 +178,20 @@
     }
 
 
-    public LinkedHashSet start() {
+    public LinkedHashSet<Artifact> start() {
         if (!loaded) {
             throw new IllegalStateException(configurationId + " is not loaded");
         }
-        LinkedHashSet startList = new LinkedHashSet();
+        LinkedHashSet<Artifact> startList = new LinkedHashSet<Artifact>();
         startInternal(startList);
         userLoaded = true;
         userStarted = true;
         return startList;
     }
 
-    private void startInternal(LinkedHashSet startList) {
+    private void startInternal(LinkedHashSet<Artifact> startList) {
         // visit all stopped parents
-        for (Iterator iterator = startParents.iterator(); iterator.hasNext();) {
-            ConfigurationStatus parent = (ConfigurationStatus) iterator.next();
+        for (ConfigurationStatus parent : startParents) {
             if (!parent.isStarted()) {
                 parent.startInternal(startList);
             }
@@ -219,29 +206,29 @@
     /**
      * Stop this configuration and its children (if it's running) or do nothing
      * (if it's not running).
+     * @param gc whether to gc (??)
+     * @return list of Artifacts for stopped configurations
      */
-    public LinkedHashSet stop(boolean gc) {
-        LinkedHashSet stopStatuses = new LinkedHashSet();
+    public LinkedHashSet<Artifact> stop(boolean gc) {
+        LinkedHashSet<ConfigurationStatus> stopStatuses = new LinkedHashSet<ConfigurationStatus>();
         stopInternal(stopStatuses, gc);
 
-        LinkedHashSet stopIds = new LinkedHashSet(stopStatuses.size());
-        for (Iterator iterator = stopStatuses.iterator(); iterator.hasNext();) {
-            ConfigurationStatus configurationStatus = (ConfigurationStatus) iterator.next();
+        LinkedHashSet<Artifact> stopIds = new LinkedHashSet<Artifact>(stopStatuses.size());
+        for (ConfigurationStatus configurationStatus : stopStatuses) {
             stopIds.add(configurationStatus.configurationId);
         }
 
         return stopIds;
     }
 
-    private void stopInternal(LinkedHashSet stopList, boolean gc) {
+    private void stopInternal(LinkedHashSet<ConfigurationStatus> stopList, boolean gc) {
         // if we aren't started, there is nothing to do
         if (!started) {
             return;
         }
 
         // visit all children
-        for (Iterator iterator = startChildren.iterator(); iterator.hasNext();) {
-            ConfigurationStatus child = (ConfigurationStatus) iterator.next();
+        for (ConfigurationStatus child : startChildren) {
             if (child.isStarted()) {
                 child.stopInternal(stopList, gc);
             }
@@ -256,8 +243,7 @@
             // if we are garbage collecting, visit parents
             if (gc) {
                 // visit all non-user started parents that haven't already been visited
-                for (Iterator iterator = startParents.iterator(); iterator.hasNext();) {
-                    ConfigurationStatus parent = (ConfigurationStatus) iterator.next();
+                for (ConfigurationStatus parent : startParents) {
                     if (!parent.isUserStarted() && stopList.containsAll(parent.startChildren)) {
                         parent.stopInternal(stopList, gc);
                     }
@@ -266,17 +252,16 @@
         }
     }
 
-    public LinkedHashSet restart() {
+    public LinkedHashSet<Artifact> restart() {
         if (!started) {
             throw new IllegalStateException(configurationId + " is not started");
         }
 
-        LinkedHashSet restartStatuses = new LinkedHashSet();
+        LinkedHashSet<ConfigurationStatus> restartStatuses = new LinkedHashSet<ConfigurationStatus>();
         restartInternal(restartStatuses);
 
-        LinkedHashSet restartIds = new LinkedHashSet(restartStatuses.size());
-        for (Iterator iterator = restartStatuses.iterator(); iterator.hasNext();) {
-            ConfigurationStatus configurationStatus = (ConfigurationStatus) iterator.next();
+        LinkedHashSet<Artifact> restartIds = new LinkedHashSet<Artifact>(restartStatuses.size());
+        for (ConfigurationStatus configurationStatus : restartStatuses) {
             restartIds.add(configurationStatus.configurationId);
         }
 
@@ -285,15 +270,14 @@
         return restartIds;
     }
 
-    private void restartInternal(LinkedHashSet restartList) {
+    private void restartInternal(LinkedHashSet<ConfigurationStatus> restartList) {
         // if we aren't started, there is nothing to do
         if (!started) {
             return;
         }
 
         // visit all children
-        for (Iterator iterator = startChildren.iterator(); iterator.hasNext();) {
-            ConfigurationStatus child = (ConfigurationStatus) iterator.next();
+        for (ConfigurationStatus child : startChildren) {
             if (child.isStarted()) {
                 child.restartInternal(restartList);
             }
@@ -306,30 +290,30 @@
     /**
      * Unload the configuration and all its children (if it's loaded), or do
      * nothing (if it's not loaded).
+     * @param gc whether to gc (??)
+     * @return artifacts for unloaded configurations
      */
-    public LinkedHashSet unload(boolean gc) {
+    public LinkedHashSet<Artifact> unload(boolean gc) {
 
-        LinkedHashSet unloadStatuses = new LinkedHashSet();
+        LinkedHashSet<ConfigurationStatus> unloadStatuses = new LinkedHashSet<ConfigurationStatus>();
         unloadInternal(unloadStatuses, gc);
 
-        LinkedHashSet unloadIds = new LinkedHashSet(unloadStatuses.size());
-        for (Iterator iterator = unloadStatuses.iterator(); iterator.hasNext();) {
-            ConfigurationStatus configurationStatus = (ConfigurationStatus) iterator.next();
+        LinkedHashSet<Artifact> unloadIds = new LinkedHashSet<Artifact>(unloadStatuses.size());
+        for (ConfigurationStatus configurationStatus : unloadStatuses) {
             unloadIds.add(configurationStatus.configurationId);
         }
 
         return unloadIds;
     }
 
-    private void unloadInternal(LinkedHashSet unloadList, boolean gc) {
+    private void unloadInternal(LinkedHashSet<ConfigurationStatus> unloadList, boolean gc) {
         // if we aren't loaded, there is nothing to do
         if (!loaded) {
             return;
         }
 
         // visit all loaded children
-        for (Iterator iterator = loadChildren.iterator(); iterator.hasNext();) {
-            ConfigurationStatus child = (ConfigurationStatus) iterator.next();
+        for (ConfigurationStatus child : loadChildren) {
             if (child.isLoaded()) {
                 child.unloadInternal(unloadList, gc);
             }
@@ -346,8 +330,7 @@
             // if we are garbage collecting, visit parents
             if (gc) {
                 // visit all non-user loaded parents
-                for (Iterator iterator = loadParents.iterator(); iterator.hasNext();) {
-                    ConfigurationStatus parent = (ConfigurationStatus) iterator.next();
+                for (ConfigurationStatus parent : loadParents) {
                     if (!parent.isUserLoaded() && unloadList.containsAll(parent.loadChildren)) {
                         parent.unloadInternal(unloadList, gc);
                     }
@@ -356,17 +339,16 @@
         }
     }
 
-    public LinkedHashSet reload() {
+    public LinkedHashSet<Artifact> reload() {
         if (!loaded) {
             throw new IllegalStateException(configurationId + " is not loaded");
         }
 
-        LinkedHashSet reloadStatuses = new LinkedHashSet();
+        LinkedHashSet<ConfigurationStatus> reloadStatuses = new LinkedHashSet<ConfigurationStatus>();
         reloadInternal(reloadStatuses);
 
-        LinkedHashSet reloadIds = new LinkedHashSet(reloadStatuses.size());
-        for (Iterator iterator = reloadStatuses.iterator(); iterator.hasNext();) {
-            ConfigurationStatus configurationStatus = (ConfigurationStatus) iterator.next();
+        LinkedHashSet<Artifact> reloadIds = new LinkedHashSet<Artifact>(reloadStatuses.size());
+        for (ConfigurationStatus configurationStatus : reloadStatuses) {
             reloadIds.add(configurationStatus.configurationId);
         }
 
@@ -374,15 +356,14 @@
         return reloadIds;
     }
 
-    private void reloadInternal(LinkedHashSet reloadList) {
+    private void reloadInternal(LinkedHashSet<ConfigurationStatus> reloadList) {
         // if we aren't loaded, there is nothing to do
         if (!loaded) {
             return;
         }
 
         // visit all children
-        for (Iterator iterator = loadChildren.iterator(); iterator.hasNext();) {
-            ConfigurationStatus child = (ConfigurationStatus) iterator.next();
+        for (ConfigurationStatus child : loadChildren) {
             if (child.isLoaded()) {
                 child.reloadInternal(reloadList);
             }

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/GBeanState.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/GBeanState.java?rev=747165&r1=747164&r2=747165&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/GBeanState.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/GBeanState.java Mon Feb 23 22:27:34 2009
@@ -27,7 +27,7 @@
  * @version $Rev$ $Date$
  */
 public interface GBeanState {
-    List getGBeans(ClassLoader classLoader) throws InvalidConfigException;
+    List<GBeanData> getGBeans(ClassLoader classLoader) throws InvalidConfigException;
 
     void addGBean(GBeanData gbeanData);
 

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/LifecycleResults.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/LifecycleResults.java?rev=747165&r1=747164&r2=747165&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/LifecycleResults.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/LifecycleResults.java Mon Feb 23 22:27:34 2009
@@ -16,13 +16,12 @@
  */
 package org.apache.geronimo.kernel.config;
 
-import java.util.LinkedHashSet;
+import java.io.Serializable;
+import java.util.Collections;
 import java.util.LinkedHashMap;
-import java.util.Set;
+import java.util.LinkedHashSet;
 import java.util.Map;
-import java.util.Collections;
-import java.util.Iterator;
-import java.io.Serializable;
+import java.util.Set;
 
 import org.apache.geronimo.kernel.repository.Artifact;
 
@@ -32,11 +31,11 @@
  */
 public class LifecycleResults implements Serializable {
     private static final long serialVersionUID = 4660197333193740244L;
-    private final Set loaded = new LinkedHashSet();
-    private final Set unloaded = new LinkedHashSet();
-    private final Set started = new LinkedHashSet();
-    private final Set stopped = new LinkedHashSet();
-    private final Map failed = new LinkedHashMap();
+    private final Set<Artifact> loaded = new LinkedHashSet<Artifact>();
+    private final Set<Artifact> unloaded = new LinkedHashSet<Artifact>();
+    private final Set<Artifact> started = new LinkedHashSet<Artifact>();
+    private final Set<Artifact> stopped = new LinkedHashSet<Artifact>();
+    private final Map<Artifact, Throwable> failed = new LinkedHashMap<Artifact, Throwable>();
 
     /**
      * Checks whether the specified configuration was loaded.
@@ -54,7 +53,7 @@
      * Gets the configuration identifiers (Artifact) of the configurations loaded.
      * @return the configuration identifiers (Artifact)
      */
-    public Set getLoaded() {
+    public Set<Artifact> getLoaded() {
         return Collections.unmodifiableSet(loaded);
     }
 
@@ -70,7 +69,7 @@
      * Clears the existing loaded set and add alls the specified configurations to the set
      * @param loaded the configuration identifiers (Artifact)
      */
-    public void setLoaded(Set loaded) {
+    public void setLoaded(Set<Artifact> loaded) {
         this.loaded.clear();
         this.loaded.addAll(loaded);
     }
@@ -91,7 +90,7 @@
      * Gets the configuration identifiers (Artifact) of the configurations unloaded.
      * @return the configuration identifiers (Artifact)
      */
-    public Set getUnloaded() {
+    public Set<Artifact> getUnloaded() {
         return Collections.unmodifiableSet(unloaded);
     }
 
@@ -107,7 +106,7 @@
      * Clears the existing unloaded set and add alls the specified configurations to the set
      * @param unloaded the configuration identifiers (Artifact)
      */
-    public void setUnloaded(Set unloaded) {
+    public void setUnloaded(Set<Artifact> unloaded) {
         this.unloaded.clear();
         this.unloaded.addAll(unloaded);
     }
@@ -128,7 +127,7 @@
      * Gets the configuration identifiers (Artifact) of the configurations started.
      * @return the configuration identifiers (Artifact)
      */
-    public Set getStarted() {
+    public Set<Artifact> getStarted() {
         return Collections.unmodifiableSet(started);
     }
 
@@ -144,7 +143,7 @@
      * Clears the existing started set and add alls the specified configurations to the set
      * @param started the configuration identifiers (Artifact)
      */
-    public void setStarted(Set started) {
+    public void setStarted(Set<Artifact> started) {
         this.started.clear();
         this.started.addAll(started);
     }
@@ -165,7 +164,7 @@
      * Gets the configuration identifiers (Artifact) of the configurations stopped.
      * @return the configuration identifiers (Artifact)
      */
-    public Set getStopped() {
+    public Set<Artifact> getStopped() {
         return Collections.unmodifiableSet(stopped);
     }
 
@@ -181,7 +180,7 @@
      * Clears the existing stopped set and add alls the specified configurations to the set
      * @param stopped the configuration identifiers (Artifact)
      */
-    public void setStopped(Set stopped) {
+    public void setStopped(Set<Artifact> stopped) {
         this.stopped.clear();
         this.stopped.addAll(stopped);
     }
@@ -199,9 +198,8 @@
      *              operation
      */
     public boolean wasFailed(Artifact configurationId) {
-        for (Iterator it = failed.keySet().iterator(); it.hasNext();) {
-            Artifact failID = (Artifact) it.next();
-            if(configurationId.matches(failID)) {
+        for (Artifact failID : failed.keySet()) {
+            if (configurationId.matches(failID)) {
                 return true;
             }
         }
@@ -210,17 +208,18 @@
 
     /**
      * Gets the exception that caused the operation on the specified configuration to fail.
+     * @param configurationId id for artifact we are asking about
      * @return the configuration identifiers (Artifact)
      */
     public Throwable getFailedCause(Artifact configurationId) {
-        return (Throwable) failed.get(configurationId);
+        return failed.get(configurationId);
     }
 
     /**
      * Gets the configuration identifiers (Artifact) of the configurations that failed the operation and threw an exception.
      * @return the configuration identifiers (Artifact)
      */
-    public Map getFailed() {
+    public Map<Artifact, Throwable> getFailed() {
         return Collections.unmodifiableMap(failed);
     }
 
@@ -237,7 +236,7 @@
      * Clears the existing failed map and add alls the specified configurations to the map
      * @param failed a map from configuration identifier (Artifact) to causal exception
      */
-    public void setFailed(Map failed) {
+    public void setFailed(Map<Artifact, Throwable> failed) {
         this.failed.clear();
         this.failed.putAll(failed);
     }

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SerializedGBeanState.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SerializedGBeanState.java?rev=747165&r1=747164&r2=747165&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SerializedGBeanState.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/SerializedGBeanState.java Mon Feb 23 22:27:34 2009
@@ -16,22 +16,21 @@
  */
 package org.apache.geronimo.kernel.config;
 
-import java.io.Serializable;
-import java.io.IOException;
-import java.io.ObjectInputStream;
 import java.io.ByteArrayInputStream;
-import java.io.EOFException;
 import java.io.ByteArrayOutputStream;
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
-import java.util.List;
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Iterator;
+import java.util.List;
 
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.ObjectInputStreamExt;
 import org.apache.geronimo.kernel.repository.Environment;
@@ -45,20 +44,20 @@
     /**
      * GBeans contained in this configuration.
      */
-    private final List gbeans = new ArrayList();
+    private final List<GBeanData> gbeans = new ArrayList<GBeanData>();
 
     /**
      * The serialized form of the gbeans.  Once this is set on more gbeans can be added.
      */
     private byte[] gbeanState;
 
-    public SerializedGBeanState(Collection gbeans) {
+    public SerializedGBeanState(Collection<GBeanData> gbeans) {
         if (gbeans != null){
             this.gbeans.addAll(gbeans);
         }
     }
 
-    public List getGBeans(ClassLoader classLoader) throws InvalidConfigException {
+    public List<GBeanData> getGBeans(ClassLoader classLoader) throws InvalidConfigException {
         if (gbeanState == null) {
             return Collections.unmodifiableList(gbeans);
         }
@@ -96,8 +95,8 @@
         stream.defaultWriteObject();
     }
 
-    private static List loadGBeans(byte[] gbeanState, ClassLoader classLoader) throws InvalidConfigException {
-        List gbeans = new ArrayList();
+    private static List<GBeanData> loadGBeans(byte[] gbeanState, ClassLoader classLoader) throws InvalidConfigException {
+        List<GBeanData> gbeans = new ArrayList<GBeanData>();
         if (gbeanState != null && gbeanState.length > 0) {
             // Set the thread context classloader so deserializing classes can grab the cl from the thread
             ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
@@ -129,7 +128,7 @@
         return gbeans;
     }
 
-    private static byte[] storeGBeans(List gbeans) throws IOException {
+    private static byte[] storeGBeans(List<GBeanData> gbeans) throws IOException {
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream oos;
         try {
@@ -137,8 +136,7 @@
         } catch (IOException e) {
             throw (AssertionError) new AssertionError("Unable to initialize ObjectOutputStream").initCause(e);
         }
-        for (Iterator iterator = gbeans.iterator(); iterator.hasNext();) {
-            GBeanData gbeanData = (GBeanData) iterator.next();
+        for (GBeanData gbeanData : gbeans) {
             try {
                 gbeanData.writeExternal(oos);
             } catch (Exception e) {
@@ -146,7 +144,7 @@
                 // HACK:
                 //
                 System.err.println("FAILED TO SERIALIZE: " + gbeanData.getGBeanInfo());
-                
+
                 throw (IOException) new IOException("Unable to serialize GBeanData for " + gbeanData.getAbstractName()).initCause(e);
             }
         }



Mime
View raw message