axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davidills...@apache.org
Subject svn commit: r573221 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java
Date Thu, 06 Sep 2007 11:17:00 GMT
Author: davidillsley
Date: Thu Sep  6 04:16:59 2007
New Revision: 573221

URL: http://svn.apache.org/viewvc?rev=573221&view=rev
Log:
Fix for thread safety issue. Multiple puts to a standard HashMap from different threads may
result in lost data

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java?rev=573221&r1=573220&r2=573221&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java
Thu Sep  6 04:16:59 2007
@@ -19,17 +19,19 @@
 
 package org.apache.axis2.util;
 
+import java.util.Map;
+
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.addressing.RelatesTo;
 import org.apache.axis2.client.async.AsyncResult;
-import org.apache.axis2.client.async.Callback;
 import org.apache.axis2.client.async.AxisCallback;
+import org.apache.axis2.client.async.Callback;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.engine.MessageReceiver;
 
-import java.util.HashMap;
+import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
 
 /**
  * This is a MessageReceiver which is used on the client side to accept the
@@ -38,10 +40,10 @@
  */
 public class CallbackReceiver implements MessageReceiver {
     public static String SERVICE_NAME = "ClientService";
-    private HashMap callbackStore;
+    private ConcurrentHashMap callbackStore;
 
     public CallbackReceiver() {
-        callbackStore = new HashMap();
+        callbackStore = new ConcurrentHashMap();
     }
 
     public void addCallback(String MsgID, Callback callback) {
@@ -112,7 +114,7 @@
     }
 
     //to get the pending request
-    public HashMap getCallbackStore() {
+    public Map getCallbackStore() {
         return callbackStore;
     }
 }



---------------------------------------------------------------------
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