public interface AsyncDistributedLock extends DistributedPrimitive
DistributedPrimitive.Status, DistributedPrimitive.TypeDEFAULT_OPERATION_TIMEOUT_MILLIS, DEFAULT_OPERTATION_TIMEOUT_MILLIS| Modifier and Type | Method and Description |
|---|---|
default DistributedLock |
asLock() |
default DistributedLock |
asLock(long timeoutMillis) |
java.util.concurrent.CompletableFuture<Version> |
lock()
Acquires the lock, blocking until it's available.
|
default DistributedPrimitive.Type |
primitiveType()
Returns the type of primitive.
|
java.util.concurrent.CompletableFuture<java.util.Optional<Version>> |
tryLock()
Attempts to acquire the lock.
|
java.util.concurrent.CompletableFuture<java.util.Optional<Version>> |
tryLock(java.time.Duration timeout)
Attempts to acquire the lock for a specified amount of time.
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
unlock()
Unlocks the lock.
|
addStatusChangeListener, applicationId, destroy, name, removeStatusChangeListener, statusChangeListenersdefault DistributedPrimitive.Type primitiveType()
DistributedPrimitiveprimitiveType in interface DistributedPrimitivejava.util.concurrent.CompletableFuture<Version> lock()
java.util.concurrent.CompletableFuture<java.util.Optional<Version>> tryLock()
java.util.concurrent.CompletableFuture<java.util.Optional<Version>> tryLock(java.time.Duration timeout)
timeout - the timeout after which to give up attempting to acquire the lockjava.util.concurrent.CompletableFuture<java.lang.Void> unlock()
default DistributedLock asLock()
default DistributedLock asLock(long timeoutMillis)