public interface RLockAsync
| Modifier and Type | Method and Description |
|---|---|
RFuture<Boolean> |
forceUnlockAsync()
Unlocks the lock independently of its state
|
RFuture<Integer> |
getHoldCountAsync()
Number of holds on this lock by the current thread
|
RFuture<Boolean> |
isLockedAsync()
Checks if the lock locked by any thread
|
RFuture<Void> |
lockAsync()
Acquires the lock.
|
RFuture<Void> |
lockAsync(long threadId)
Acquires the lock by thread with defined
threadId. |
RFuture<Void> |
lockAsync(long leaseTime,
TimeUnit unit)
Acquires the lock with defined
leaseTime. |
RFuture<Void> |
lockAsync(long leaseTime,
TimeUnit unit,
long threadId)
Acquires the lock with defined
leaseTime and threadId. |
RFuture<Long> |
remainTimeToLiveAsync()
Remaining time to live of the lock
|
RFuture<Boolean> |
tryLockAsync()
Tries to acquire the lock.
|
RFuture<Boolean> |
tryLockAsync(long threadId)
Tries to acquire the lock by thread with specified
threadId. |
RFuture<Boolean> |
tryLockAsync(long waitTime,
long leaseTime,
TimeUnit unit)
Tries to acquire the lock with defined
leaseTime. |
RFuture<Boolean> |
tryLockAsync(long waitTime,
long leaseTime,
TimeUnit unit,
long threadId)
Tries to acquire the lock by thread with specified
threadId and leaseTime. |
RFuture<Boolean> |
tryLockAsync(long waitTime,
TimeUnit unit)
Tries to acquire the lock.
|
RFuture<Void> |
unlockAsync()
Unlocks the lock
|
RFuture<Void> |
unlockAsync(long threadId)
Unlocks the lock.
|
RFuture<Boolean> forceUnlockAsync()
true if lock existed and now unlocked
otherwise falseRFuture<Void> unlockAsync(long threadId)
IllegalMonitorStateException
if lock isn't locked by thread with specified threadId.threadId - id of threadRFuture<Boolean> tryLockAsync()
true if lock acquired otherwise falseRFuture<Void> lockAsync()
RFuture<Void> lockAsync(long threadId)
threadId.
Waits if necessary until lock became available.threadId - id of threadRFuture<Void> lockAsync(long leaseTime, TimeUnit unit)
leaseTime.
Waits if necessary until lock became available.
Lock will be released automatically after defined leaseTime interval.leaseTime - the maximum time to hold the lock after it's acquisition,
if it hasn't already been released by invoking unlock.
If leaseTime is -1, hold the lock until explicitly unlocked.unit - the time unitRFuture<Void> lockAsync(long leaseTime, TimeUnit unit, long threadId)
leaseTime and threadId.
Waits if necessary until lock became available.
Lock will be released automatically after defined leaseTime interval.leaseTime - the maximum time to hold the lock after it's acquisition,
if it hasn't already been released by invoking unlock.
If leaseTime is -1, hold the lock until explicitly unlocked.unit - the time unitthreadId - id of threadRFuture<Boolean> tryLockAsync(long threadId)
threadId.threadId - id of threadtrue if lock acquired otherwise falseRFuture<Boolean> tryLockAsync(long waitTime, TimeUnit unit)
waitTime if necessary until the lock became available.waitTime - the maximum time to acquire the lockunit - time unittrue if lock is successfully acquired,
otherwise false if lock is already set.RFuture<Boolean> tryLockAsync(long waitTime, long leaseTime, TimeUnit unit)
leaseTime.
Waits up to defined waitTime if necessary until the lock became available.
Lock will be released automatically after defined leaseTime interval.waitTime - the maximum time to acquire the lockleaseTime - lease timeunit - time unittrue if lock is successfully acquired,
otherwise false if lock is already set.RFuture<Boolean> tryLockAsync(long waitTime, long leaseTime, TimeUnit unit, long threadId)
threadId and leaseTime.
Waits up to defined waitTime if necessary until the lock became available.
Lock will be released automatically after defined leaseTime interval.threadId - id of threadwaitTime - time interval to acquire lockleaseTime - time interval after which lock will be released automaticallyunit - the time unit of the waitTime and leaseTime argumentstrue if lock acquired otherwise falseRFuture<Integer> getHoldCountAsync()
0 if this lock is not held by current threadRFuture<Boolean> isLockedAsync()
true if locked otherwise falseCopyright © 2014–2021 Redisson. All rights reserved.