Package org.redisson
Class RedissonRedLock
java.lang.Object
org.redisson.RedissonMultiLock
org.redisson.RedissonRedLock
- All Implemented Interfaces:
Lock
,RLock
,RLockAsync
RedLock locking algorithm implementation for multiple locks.
It manages all locks as one.
- Author:
- Nikita Koksharov
- See Also:
-
Constructor Summary
ConstructorDescriptionRedissonRedLock
(RLock... locks) Creates instance with multipleRLock
objects. -
Method Summary
Modifier and TypeMethodDescriptionprotected long
calcLockWaitTime
(long remainTime) protected int
protected int
minLocksAmount
(List<RLock> locks) void
unlock()
Methods inherited from class org.redisson.RedissonMultiLock
forceUnlock, forceUnlockAsync, getHoldCount, getHoldCountAsync, getName, isHeldByCurrentThread, isHeldByThread, isLocked, isLockedAsync, lock, lock, lockAsync, lockAsync, lockAsync, lockAsync, lockInterruptibly, lockInterruptibly, newCondition, remainTimeToLive, remainTimeToLiveAsync, tryLock, tryLock, tryLock, tryLockAsync, tryLockAsync, tryLockAsync, tryLockAsync, tryLockAsync, tryLockAsyncCycle, unlockAsync, unlockAsync, unlockInner, unlockInnerAsync
-
Constructor Details
-
RedissonRedLock
Creates instance with multipleRLock
objects. Each RLock object could be created by own Redisson instance.- Parameters:
locks
- - array of locks
-
-
Method Details
-
failedLocksLimit
protected int failedLocksLimit()- Overrides:
failedLocksLimit
in classRedissonMultiLock
-
minLocksAmount
-
calcLockWaitTime
protected long calcLockWaitTime(long remainTime) - Overrides:
calcLockWaitTime
in classRedissonMultiLock
-
unlock
public void unlock()- Specified by:
unlock
in interfaceLock
- Overrides:
unlock
in classRedissonMultiLock
-