Package nablarch.core.util.map
Class LockableMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
nablarch.core.util.map.MapWrapper<K,V>
nablarch.core.util.map.LockableMap<K,V>
- Type Parameters:
K- キーの型V- 値の型
- Direct Known Subclasses:
ExclusiveAccessMap
排他ロックを内蔵したMapのラッパークラス。
- Author:
- Iwauo Tajima
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
ConstructorsConstructorDescriptionLockableMap(Map<K, V> baseMap) コンストラクタ。LockableMap(Map<K, V> baseMap, ReentrantLock lock) コンストラクタ -
Method Summary
Methods inherited from class nablarch.core.util.map.MapWrapper
clear, containsKey, containsValue, entrySet, equals, get, getDelegateMapOfType, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, valuesMethods inherited from class java.util.AbstractMap
cloneMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
LockableMap
コンストラクタ。- Parameters:
baseMap- ラップ対象のMap
-
LockableMap
コンストラクタ- Parameters:
baseMap- ラップ対象のMaplock- ロックオブジェクト
-
-
Method Details
-
getDelegateMap
Description copied from class:MapWrapperこのラッパーが処理を委譲するMapオブジェクトを返す。- Specified by:
getDelegateMapin classMapWrapper<K,V> - Returns:
- 処理を委譲するMapオブジェクト
-
unlock
public void unlock() -
lock
public void lock() -
deactivate
public void deactivate()排他ロックを無効化する。 以降、どのスレッドも新たなロックを獲得することはできない。 (開放は可能。) -
lockInterruptibly
- Specified by:
lockInterruptiblyin interfaceLock- Throws:
InterruptedException
-
newCondition
- Specified by:
newConditionin interfaceLock
-
tryLock
public boolean tryLock() -
tryLock
-