com.hazelcast.util
Class ConcurrencyUtil

java.lang.Object
  extended by com.hazelcast.util.ConcurrencyUtil

public final class ConcurrencyUtil
extends Object

Utility methods to getOrPutSynchronized and getOrPutIfAbsent in thread safe way from ConcurrentMap with a ConstructorFunction .


Method Summary
static
<K,V> V
getOrPutIfAbsent(ConcurrentMap<K,V> map, K key, ConstructorFunction<K,V> func)
           
static
<K,V> V
getOrPutSynchronized(ConcurrentMap<K,V> map, K key, Object mutex, ConstructorFunction<K,V> func)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getOrPutSynchronized

public static <K,V> V getOrPutSynchronized(ConcurrentMap<K,V> map,
                                           K key,
                                           Object mutex,
                                           ConstructorFunction<K,V> func)

getOrPutIfAbsent

public static <K,V> V getOrPutIfAbsent(ConcurrentMap<K,V> map,
                                       K key,
                                       ConstructorFunction<K,V> func)


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.