Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


com.tangosol.util
Class MultiBinaryLongMap.PrimaryBinaryLongMap.ValidatingLock

java.lang.Object
  extended by com.tangosol.util.MultiBinaryLongMap.PrimaryBinaryLongMap.ValidatingLock

All Implemented Interfaces:
java.util.concurrent.locks.Lock
Enclosing class:
MultiBinaryLongMap.PrimaryBinaryLongMap

protected class MultiBinaryLongMap.PrimaryBinaryLongMap.ValidatingLock
extends java.lang.Object
implements java.util.concurrent.locks.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 Summary
protected  java.util.concurrent.locks.Lock f_lock
          The underlying lock.
protected  BinaryLongMap m_blmImpl
          The primary BinaryLongMap implementation to check for

 

Constructor Summary
MultiBinaryLongMap.PrimaryBinaryLongMap.ValidatingLock(BinaryLongMap blm, java.util.concurrent.locks.Lock lock)
          Construct a ValidatingLock backed by the specified Lock.
MultiBinaryLongMap.PrimaryBinaryLongMap.ValidatingLock(java.util.concurrent.locks.Lock lock)
          Construct a ValidatingLock backed by the specified Lock.

 

Method Summary
protected  BinaryLongMap getImplMap()
          Return the primary BinaryLongMap implementation validate by this ValidatingLock.
 void lock()
          
 void lockInterruptibly()
          
 java.util.concurrent.locks.Condition newCondition()
          
protected  void setImplMap(BinaryLongMap blmImpl)
          Set the primary BinaryLongMap implementation to be validated by this ValidatingLock.
 boolean tryLock()
          
 boolean tryLock(long cTime, java.util.concurrent.TimeUnit unit)
          
 void unlock()
          
protected  void validate()
          Validate that the BinaryLongMap associated with this ValidatingLock is still the implementation map of the containing PrimaryBinaryLongMap.

 

Field Detail

f_lock

protected final java.util.concurrent.locks.Lock f_lock
The underlying lock.

m_blmImpl

protected BinaryLongMap m_blmImpl
The primary BinaryLongMap implementation to check for

Constructor Detail

MultiBinaryLongMap.PrimaryBinaryLongMap.ValidatingLock

public MultiBinaryLongMap.PrimaryBinaryLongMap.ValidatingLock(java.util.concurrent.locks.Lock lock)
Construct a ValidatingLock backed by the specified Lock.
Parameters:
lock - the underlying lock

MultiBinaryLongMap.PrimaryBinaryLongMap.ValidatingLock

public MultiBinaryLongMap.PrimaryBinaryLongMap.ValidatingLock(BinaryLongMap blm,
                                                              java.util.concurrent.locks.Lock lock)
Construct a ValidatingLock backed by the specified Lock.
Parameters:
blm - the primary BinaryLongMap implementation to validate
lock - the underlying lock

Method Detail

unlock

public void unlock()
Specified by:
unlock in interface java.util.concurrent.locks.Lock

lock

public void lock()
Specified by:
lock in interface java.util.concurrent.locks.Lock

lockInterruptibly

public void lockInterruptibly()
                       throws java.lang.InterruptedException
Specified by:
lockInterruptibly in interface java.util.concurrent.locks.Lock
Throws:
java.lang.InterruptedException

tryLock

public boolean tryLock()
Specified by:
tryLock in interface java.util.concurrent.locks.Lock

tryLock

public boolean tryLock(long cTime,
                       java.util.concurrent.TimeUnit unit)
                throws java.lang.InterruptedException
Specified by:
tryLock in interface java.util.concurrent.locks.Lock
Throws:
java.lang.InterruptedException

newCondition

public java.util.concurrent.locks.Condition newCondition()
Specified by:
newCondition in interface java.util.concurrent.locks.Lock

getImplMap

protected BinaryLongMap getImplMap()
Return the primary BinaryLongMap implementation validate by this ValidatingLock.
Returns:
the primary BinaryLongMap implementation validated by this ValidatingLock

setImplMap

protected void setImplMap(BinaryLongMap blmImpl)
Set the primary BinaryLongMap implementation to be validated by this ValidatingLock.
Parameters:
blmImpl - the primary BinaryLongMap implementation

validate

protected 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.


Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.