axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r616761 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java
Date Wed, 30 Jan 2008 13:50:11 GMT
Author: dims
Date: Wed Jan 30 05:50:03 2008
New Revision: 616761

URL: http://svn.apache.org/viewvc?rev=616761&view=rev
Log:
Fix for AXIS2-3484 - The ConfigurationContext in Axis2-Kernal causes ConcurrentModificationException
in Session-Scope and thus is not multithreading-able

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java?rev=616761&r1=616760&r2=616761&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java
Wed Jan 30 05:50:03 2008
@@ -661,16 +661,19 @@
             return;
         }
         long currentTime = new Date().getTime();
-        for (Iterator sgCtxtMapKeyIter = serviceGroupContextMap.keySet().iterator();
-             sgCtxtMapKeyIter.hasNext();) {
-            String sgCtxtId = (String) sgCtxtMapKeyIter.next();
-            ServiceGroupContext serviceGroupContext =
-                    (ServiceGroupContext) serviceGroupContextMap.get(sgCtxtId);
-            if ((currentTime - serviceGroupContext.getLastTouchedTime()) >
-                getServiceGroupContextTimoutInterval()) {
-                sgCtxtMapKeyIter.remove();
-                cleanupServiceContexts(serviceGroupContext);
-                contextRemoved(serviceGroupContext);
+        
+        synchronized (serviceGroupContextMap) { 
+            for (Iterator sgCtxtMapKeyIter = serviceGroupContextMap.keySet().iterator();
+                 sgCtxtMapKeyIter.hasNext();) {
+                String sgCtxtId = (String) sgCtxtMapKeyIter.next();
+                ServiceGroupContext serviceGroupContext =
+                        (ServiceGroupContext) serviceGroupContextMap.get(sgCtxtId);
+                if ((currentTime - serviceGroupContext.getLastTouchedTime()) >
+                    getServiceGroupContextTimoutInterval()) {
+                    sgCtxtMapKeyIter.remove();
+                    cleanupServiceContexts(serviceGroupContext);
+                    contextRemoved(serviceGroupContext);
+                }
             }
         }
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message