Package com.tangosol.util
Class MultiBinaryLongMap.PrimaryBinaryLongMap.ValidatingLock
java.lang.Object
com.tangosol.util.MultiBinaryLongMap.PrimaryBinaryLongMap.ValidatingLock
- All Implemented Interfaces:
- Lock
- Enclosing class:
- MultiBinaryLongMap.PrimaryBinaryLongMap
protected class MultiBinaryLongMap.PrimaryBinaryLongMap.ValidatingLock
extends Object
implements Lock
ValidatingLock is a Lock implementation specialized for the
 PrimaryBinaryLongMap that validates after every lock acquisition that
 the underlying BinaryLongMap implementation did not change.
 
Note: ValidatingLock is assumed to be used by the PrimaryBinaryLongMap to wrap lock implementations that are dependent (chained) to the "master" RW-lock. As the master RW-lock is used to protect any structural changes, it also implicitly serves as a JMM memory barrier that guarantees a "flush" of the map implementation reference.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final LockThe underlying lock.protected BinaryLongMapThe primary BinaryLongMap implementation to check for
- 
Constructor SummaryConstructorsConstructorDescriptionValidatingLock(BinaryLongMap blm, Lock lock) Construct a ValidatingLock backed by the specified Lock.ValidatingLock(Lock lock) Construct a ValidatingLock backed by the specified Lock.
- 
Method SummaryModifier and TypeMethodDescriptionprotected BinaryLongMapReturn the primary BinaryLongMap implementation validate by this ValidatingLock.voidlock()voidprotected voidsetImplMap(BinaryLongMap blmImpl) Set the primary BinaryLongMap implementation to be validated by this ValidatingLock.booleantryLock()booleanvoidunlock()protected voidvalidate()Validate that the BinaryLongMap associated with this ValidatingLock is still the implementation map of the containing PrimaryBinaryLongMap.
- 
Field Details- 
f_lockThe underlying lock.
- 
m_blmImplThe primary BinaryLongMap implementation to check for
 
- 
- 
Constructor Details- 
ValidatingLockConstruct a ValidatingLock backed by the specified Lock.- Parameters:
- lock- the underlying lock
 
- 
ValidatingLockConstruct a ValidatingLock backed by the specified Lock.- Parameters:
- blm- the primary BinaryLongMap implementation to validate
- lock- the underlying lock
 
 
- 
- 
Method Details- 
unlockpublic void unlock()
- 
lockpublic void lock()
- 
lockInterruptibly- Specified by:
- lockInterruptiblyin interface- Lock
- Throws:
- InterruptedException
 
- 
tryLockpublic boolean tryLock()
- 
tryLock- Specified by:
- tryLockin interface- Lock
- Throws:
- InterruptedException
 
- 
newCondition- Specified by:
- newConditionin interface- Lock
 
- 
getImplMapReturn the primary BinaryLongMap implementation validate by this ValidatingLock.- Returns:
- the primary BinaryLongMap implementation validated by this ValidatingLock
 
- 
setImplMapSet the primary BinaryLongMap implementation to be validated by this ValidatingLock.- Parameters:
- blmImpl- the primary BinaryLongMap implementation
 
- 
validateprotected void validate()Validate that the BinaryLongMap associated with this ValidatingLock is still the implementation map of the containing PrimaryBinaryLongMap.Callers are required to hold the lock. Note: the lock provides a memory barrier ensuring visibility of updates to the map implementation of the outer PrimaryBinaryLongMap. 
 
-