You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2012/01/14 00:00:45 UTC

svn commit: r1231377 - /jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ClientPool.java

Author: pmouawad
Date: Fri Jan 13 23:00:45 2012
New Revision: 1231377

URL: http://svn.apache.org/viewvc?rev=1231377&view=rev
Log:
Replaced synchronized by ConcurrentHashMap

Modified:
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ClientPool.java

Modified: jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ClientPool.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ClientPool.java?rev=1231377&r1=1231376&r2=1231377&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ClientPool.java (original)
+++ jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ClientPool.java Fri Jan 13 23:00:45 2012
@@ -20,8 +20,8 @@ package org.apache.jmeter.protocol.jms.c
 import java.io.Closeable;
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 /**
  *
@@ -38,7 +38,7 @@ public class ClientPool {
     private static final ArrayList<Closeable> clients = new ArrayList<Closeable>();
 
     //GuardedBy("this")
-    private static final Map<Object, Object> client_map = new HashMap<Object, Object>();
+    private static final Map<Object, Object> client_map = new ConcurrentHashMap<Object, Object>();
 
     /**
      * Add a ReceiveClient to the ClientPool. This is so that we can make sure
@@ -71,11 +71,13 @@ public class ClientPool {
         client_map.clear();
     }
 
-    public static synchronized void put(Object key, Object client) {
+    // TODO Method with 0 reference, really useful ?
+    public static void put(Object key, Object client) {
         client_map.put(key, client);
     }
 
-    public static synchronized Object get(Object key) {
+    // TODO Method with 0 reference, really useful ?
+    public static Object get(Object key) {
         return client_map.get(key);
     }
 }