Permalink
Browse files

Use concurrentHashMap

  • Loading branch information...
1 parent 1b11d6d commit 1a0e0b5d16537fb27be9b494046045432fedc459 @ctomc ctomc committed with kabir Apr 4, 2013
@@ -26,7 +26,6 @@
import java.security.Principal;
import java.util.Arrays;
import java.util.Collections;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Iterator;
@@ -1126,7 +1125,7 @@ protected boolean canAttributeBeReplicated(Object attribute) {
log.tracef("Excluding attribute %s from replication", excludedAttributes[i]);
}
if (excluded == null) {
- excluded = new HashMap<String, Object>();
+ excluded = new ConcurrentHashMap<>();
}
excluded.put(excludedAttributes[i], attr);
}
@@ -21,8 +21,8 @@
*/
package org.jboss.as.undertow.session;
-import java.util.HashMap;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
import org.jboss.as.clustering.web.DistributableSessionMetadata;
import org.jboss.as.clustering.web.OutgoingSessionGranularitySessionData;
@@ -80,7 +80,7 @@ protected Object setAttributeInternal(String name, Object value) {
// ----------------------------------------------------------------- Private
private Map<String, Object> getSessionAttributeMap() {
- Map<String, Object> attrs = new HashMap<String, Object>(getAttributesInternal());
+ Map<String, Object> attrs = new ConcurrentHashMap<>(getAttributesInternal());
removeExcludedAttributes(attrs);
return attrs;
}
@@ -23,8 +23,8 @@
import io.undertow.server.HttpServerExchange;
-import java.util.HashMap;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import org.jboss.as.clustering.web.OutgoingDistributableSessionData;
@@ -166,7 +166,7 @@ private synchronized void addReplicatableSession(ClusteredSession<? extends Outg
soleSession = session;
} else if (!mgr.equals(soleManager)) {
// We have a cross-context call; need a Map for the sessions
- crossCtxSessions = new HashMap<ClusteredSession<? extends OutgoingDistributableSessionData>, SnapshotManager>();
+ crossCtxSessions = new ConcurrentHashMap<>();
crossCtxSessions.put(soleSession, soleManager);
crossCtxSessions.put(session, mgr);
soleManager = null;

0 comments on commit 1a0e0b5

Please sign in to comment.