public interface DistributedLock extends SyncPrimitive, Lock
DEFAULT_OPERATION_TIMEOUT_MILLIS| Modifier and Type | Method and Description |
|---|---|
AsyncDistributedLock |
async()
Returns the underlying asynchronous primitive.
|
boolean |
tryLock(Duration timeout)
Acquires the lock if it is free within the given waiting time and the
current thread has not been interrupted.
|
default boolean |
tryLock(long time,
TimeUnit unit) |
close, deleteaddStateChangeListener, name, protocol, removeStateChangeListener, typelock, lockInterruptibly, newCondition, tryLock, unlockdefault boolean tryLock(long time,
TimeUnit unit)
throws InterruptedException
tryLock in interface LockInterruptedExceptionboolean tryLock(Duration timeout) throws InterruptedException
timeout - the timeout to wait to acquire the lockInterruptedException - if the current thread is interrupted
while acquiring the lock (and interruption of lock
acquisition is supported)AsyncDistributedLock async()
SyncPrimitiveasync in interface SyncPrimitiveCopyright © 2013–2018. All rights reserved.