Java Utililty Methods ConcurrentMap

List of utility methods to do ConcurrentMap

  1. HOME
  2. Java
  3. C
  4. ConcurrentMap

Description

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

Method

void addClassMapping(String className, Class clazz)
add Class Mapping
if (className == null) {
 className = clazz.getName();
mappings.put(className, clazz);
C addConcurrent(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) {
...
int addIfAbsent(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;
...
void clearClassMapping()
clear Class Mapping
mappings.clear();
addBaseClassMappings();
void clearDefaultResourceBundles()
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);
ConcurrentMap create(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;
Map createConcurrentMap()
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) {
...
ConcurrentMap createConcurrentMap()
create Concurrent Map
return new ConcurrentHashMap<K, V>();
ConcurrentMap createConcurrentMap(int initial_capacity, float load_factor, int concurrency_level)
create Concurrent Map
return new ConcurrentHashMap<K, V>(initial_capacity, load_factor, concurrency_level);
Integer extractKeySize(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);
...


AltStyle によって変換されたページ (->オリジナル) /