axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nand...@apache.org
Subject svn commit: r684775 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
Date Mon, 11 Aug 2008 15:19:12 GMT
Author: nandana
Date: Mon Aug 11 08:19:11 2008
New Revision: 684775

URL: http://svn.apache.org/viewvc?rev=684775&view=rev
Log:
AXIS2-3958 avoiding the ConcurrentModificationException in AxisConfiguration

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java?rev=684775&r1=684774&r2=684775&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
Mon Aug 11 08:19:11 2008
@@ -87,8 +87,8 @@
 
     private URL axis2Repository = null;
 
-    private HashMap allServices = new HashMap();
-    private HashMap allEndpoints = new HashMap();
+    private Map allServices = new Hashtable();
+    private Map allEndpoints = new Hashtable();
 
     /**
      * Stores the module specified in the server.xml at the document parsing time.
@@ -411,17 +411,12 @@
             }
 
             //removes the endpoints to this service
+            String serviceName = axisService.getName();
             String key = null;
-            List endPointsForThisService = new ArrayList();
-            for (Iterator iter = this.allEndpoints.keySet().iterator(); iter.hasNext();){
-                key = (String)iter.next();
-                if (key.startsWith(axisService.getName())){
-                    endPointsForThisService.add(key);
-                }
-            }
 
-            for (Iterator iter = endPointsForThisService.iterator();iter.hasNext();){
-                this.allEndpoints.remove(iter.next());
+            for (Iterator iter = axisService.getEndpoints().keySet().iterator(); iter.hasNext();){
+                key = serviceName + "." + (String)iter.next();
+                this.allEndpoints.remove(key);
             }
 
         }
@@ -861,7 +856,13 @@
 
     // To get all the services in the system
     public HashMap getServices() {
-        return allServices;
+        HashMap hashMap = new HashMap(this.allServices.size());
+        Object key;
+        for (Iterator iter = this.allServices.keySet().iterator(); iter.hasNext();){
+            key = iter.next();
+            hashMap.put(key, this.allServices.get(key));
+        }
+        return hashMap;
     }
 
     // The class loader which become the top most parent of all the modules and



Mime
View raw message