Java Utililty Methods ConcurrentMap

List of utility methods to do ConcurrentMap

Description

The list of methods to do ConcurrentMap are organized into topic(s).

Method

voidaddClassMapping(String className, Class clazz)
add Class Mapping
if (className == null) {
    className = clazz.getName();
mappings.put(className, clazz);
CaddConcurrent(K key, C values, ConcurrentMap map)
If map already has a value associated with the key it adds values to that value, otherwise it will put values to the map.
C currentValues = map.get(key);
if (currentValues == null) {
    currentValues = map.putIfAbsent(key, values);
    if (currentValues == null) {
        return values;
synchronized (currentValues) {
...
intaddIfAbsent(K key, ConcurrentMap map, Object value)
add If Absent
for (;;) {
    Object[] newElements, elements = map.get(key);
    if (elements == null && (elements = map.putIfAbsent(key, new Object[] { value })) == null)
        return 0;
    int i, len = i = elements.length;
    while (--i >= 0) {
        if (value.equals(elements[i]))
            return -1;
...
voidclearClassMapping()
clear Class Mapping
mappings.clear();
addBaseClassMappings();
voidclearDefaultResourceBundles()
Clears the internal list of resource bundles.
ClassLoader ccl = getCurrentThreadContextClassLoader();
List<String> bundles = new ArrayList<>();
classLoaderMap.put(ccl.hashCode(), bundles);
bundles.add(0, XWORK_MESSAGES_BUNDLE);
ConcurrentMapcreate(boolean sorted)
Returns a newly created Map object.
ConcurrentMap<K, V> map;
if (sorted) {
    map = new ConcurrentSkipListMap<K, V>();
} else {
    map = new ConcurrentHashMap<K, V>();
return map;
MapcreateConcurrentMap()
INTERNAL: Creates new concurrent java.util.Map instance.
try {
    Class<?> klass = Class.forName("java.util.concurrent.ConcurrentHashMap");
    return (Map<K, V>) klass.newInstance();
} catch (Exception e1) {
    try {
        Class<?> klass = Class.forName("EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap");
        return (Map<K, V>) klass.newInstance();
    } catch (Exception e2) {
...
ConcurrentMapcreateConcurrentMap()
create Concurrent Map
return new ConcurrentHashMap<K, V>();
ConcurrentMapcreateConcurrentMap(int initial_capacity, float load_factor, int concurrency_level)
create Concurrent Map
return new ConcurrentHashMap<K, V>(initial_capacity, load_factor, concurrency_level);
IntegerextractKeySize(String sslCipherSuite)
Extract the SSL key size of a given cipher suite.
Integer keySize = keySizesCache.get(sslCipherSuite);
if (keySize == null) {
    final int encAlgorithmIndex = sslCipherSuite.indexOf("WITH_");
    if (encAlgorithmIndex >= 0) {
        final String encAlgorithm = sslCipherSuite.substring(encAlgorithmIndex + 5);
        if (encAlgorithm != null) {
            if (encAlgorithm.startsWith("NULL_")) {
                keySize = Integer.valueOf(0);
...