Package org.idempiere.distributed
Interface ICacheService
-
public interface ICacheService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <K> List<K>
getList(String name)
<K,V>
Map<K,V>getMap(String name)
<K> Set<K>
getSet(String name)
<K,V>
booleantryLock(Map<K,V> map, K key, long timeout, TimeUnit timeunit)
Tries to acquire the lock for the specified key.<K,V>
voidunLock(Map<K,V> map, K key)
Releases the lock for the specified key.
-
-
-
Method Detail
-
tryLock
<K,V> boolean tryLock(Map<K,V> map, K key, long timeout, TimeUnit timeunit) throws InterruptedException
Tries to acquire the lock for the specified key. If the lock is not available, then the current thread becomes disabled for thread scheduling purposes and lies dormant until one of two things happens - the lock is acquired by the current thread, or the specified waiting time elapses.- Parameters:
map
-key
-timeout
-timeunit
-- Returns:
- true if lock is acquired, false otherwise
- Throws:
InterruptedException
-
unLock
<K,V> void unLock(Map<K,V> map, K key)
Releases the lock for the specified key. It never blocks and returns immediately. If the current thread is the holder of this lock, then the hold count is decremented. If the hold count is zero, then the lock is released. If the current thread is not the holder of this lock, then IllegalMonitorStateException is thrown.- Parameters:
map
-key
-
-
-