Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


com.tangosol.util
Class MultiBinaryLongMap.ChainedLock

java.lang.Object
  extended by com.tangosol.util.MultiBinaryLongMap.ChainedLock

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

protected static class MultiBinaryLongMap.ChainedLock
extends java.lang.Object
implements java.util.concurrent.locks.Lock

A ChainedLock is a Lock implementation that represents a composition of two component locks, parent and child. All operations on this lock will first be performed on the parent lock, and only upon successful completion be performed on the child lock.

A ChainedLock could be used to manage multiple logical levels of concurrency control across multiple components without exposing multiple resource locks and thus imposing a locking order that reduces the possibility of introducing deadlocks.

Note: a ChainedLock could be used to represent a chain of more than two Locks by constructing a "chain of chains".


Field Summary
protected  java.util.concurrent.locks.Lock f_lockChild
          The "child" constituent lock.
protected  java.util.concurrent.locks.Lock f_lockParent
          The "parent" constituent lock.

 

Constructor Summary
MultiBinaryLongMap.ChainedLock(java.util.concurrent.locks.Lock lockParent, java.util.concurrent.locks.Lock lockChild)
          Construct a new ChainedLock composed of the specified parent and child locks.

 

Method Summary
 void lock()
          
 void lockInterruptibly()
          
 java.util.concurrent.locks.Condition newCondition()
          
 boolean tryLock()
          
 boolean tryLock(long cTime, java.util.concurrent.TimeUnit unit)
          
 void unlock()
          

 

Field Detail

f_lockParent

protected final java.util.concurrent.locks.Lock f_lockParent
The "parent" constituent lock.

f_lockChild

protected final java.util.concurrent.locks.Lock f_lockChild
The "child" constituent lock.

Constructor Detail

MultiBinaryLongMap.ChainedLock

public MultiBinaryLongMap.ChainedLock(java.util.concurrent.locks.Lock lockParent,
                                      java.util.concurrent.locks.Lock lockChild)
Construct a new ChainedLock composed of the specified parent and child locks.
Parameters:
lockParent - the parent lock
lockChild - the child lock

Method Detail

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

unlock

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

newCondition

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

Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


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