Package org.redisson.api
Interface RLockAsync
-
- All Superinterfaces:
RExpirableAsync
,RObjectAsync
- All Known Subinterfaces:
RLock
- All Known Implementing Classes:
RedissonFairLock
,RedissonLock
,RedissonReadLock
,RedissonTransactionalLock
,RedissonWriteLock
public interface RLockAsync extends RExpirableAsync
Distributed implementation ofLock
- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RFuture<Boolean>
forceUnlockAsync()
Unlocks lock independently of stateRFuture<Integer>
getHoldCountAsync()
Number of holds on this lock by the current threadRFuture<Void>
lockAsync()
RFuture<Void>
lockAsync(long threadId)
RFuture<Void>
lockAsync(long leaseTime, TimeUnit unit)
Acquires the lock.RFuture<Void>
lockAsync(long leaseTime, TimeUnit unit, long threadId)
RFuture<Boolean>
tryLockAsync()
RFuture<Boolean>
tryLockAsync(long threadId)
RFuture<Boolean>
tryLockAsync(long waitTime, long leaseTime, TimeUnit unit)
RFuture<Boolean>
tryLockAsync(long waitTime, long leaseTime, TimeUnit unit, long threadId)
RFuture<Boolean>
tryLockAsync(long waitTime, TimeUnit unit)
RFuture<Void>
unlockAsync()
RFuture<Void>
unlockAsync(long threadId)
-
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
-
Methods inherited from interface org.redisson.api.RObjectAsync
copyAsync, deleteAsync, dumpAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
-
-
-
Method Detail
-
forceUnlockAsync
RFuture<Boolean> forceUnlockAsync()
Unlocks lock independently of state- Returns:
true
if unlocked otherwisefalse
-
lockAsync
RFuture<Void> lockAsync(long leaseTime, TimeUnit unit)
Acquires the lock.If the lock is not available then the current thread becomes disabled for thread scheduling purposes and lies dormant until the lock has been acquired. If the lock is acquired, it is held until
unlock
is invoked, or until leaseTime milliseconds have passed since the lock was granted - whichever comes first.- Parameters:
leaseTime
- the maximum time to hold the lock after granting it, before automatically releasing it if it hasn't already been released by invokingunlock
. If leaseTime is -1, hold the lock until explicitly unlocked.unit
- the time unit of theleaseTime
argument- Returns:
- void
-
tryLockAsync
RFuture<Boolean> tryLockAsync(long waitTime, long leaseTime, TimeUnit unit, long threadId)
-
-