| Modifier and Type | Class and Description |
|---|---|
static class |
KeyLock.KeyLockedException |
| Modifier and Type | Method and Description |
|---|---|
int |
activeCount() |
List<K> |
activeKeys() |
static <K,V> KeyLock<K,V> |
newKeyLock() |
static <K,V> KeyLock<K,V> |
newKeyLock(boolean wait) |
protected V |
replace(V result,
Exception ex)
how to replace already computed results.
|
V |
withLock(K key,
Callable<? extends V> callable)
execute
callable while locking concurrent execution for
key |
public KeyLock()
public KeyLock(boolean wait)
wait - should withLock(Object, Callable) calls wait for
concurrent calls to finish or should they fail fastpublic static <K,V> KeyLock<K,V> newKeyLock()
public static <K,V> KeyLock<K,V> newKeyLock(boolean wait)
public V withLock(K key, Callable<? extends V> callable) throws Exception
callable while locking concurrent execution for
keykey - callable - KeyLock.KeyLockedException - only if key lock configured not to wait and key locked by
other threadException - any exception thrown by callable.call()NullPointerException - if key or callable are
nullprotected V replace(V result, Exception ex) throws Exception
result - ex - Exceptionpublic int activeCount()
Copyright © 2014 Molindo GmbH. All Rights Reserved.