Class CompositeLock
java.lang.Object
com.semedy.reasoner.utils.upgradeablelock.CompositeLock
- All Implemented Interfaces:
Lock
A lock spanning a group of backing locks. When this composite lock is locked, it locks all backing locks, and when
unlocked, it unlocks all backing locks. Employs roll back logic to ensure that either all locks are acquired
or no locks are acquired. Locks are unlocked in the reverse of the order in which the were acquired.
This class delegates most of its implementation to the
Locks
utility class.- Author:
- Niall Gallagher
-
Constructor Details
-
CompositeLock
-
CompositeLock
-
-
Method Details
-
lock
public void lock() -
lockInterruptibly
- Specified by:
lockInterruptibly
in interfaceLock
- Throws:
InterruptedException
-
tryLock
public boolean tryLock() -
tryLock
- Specified by:
tryLock
in interfaceLock
- Throws:
InterruptedException
-
unlock
public void unlock() -
newCondition
- Specified by:
newCondition
in interfaceLock
-