public interface LockManager
extends sirius.kernel.di.std.Named
Modifier and Type | Method and Description |
---|---|
List<LockInfo> |
getLocks()
Returns the list of known locks.
|
boolean |
isLocked(String lock)
Determines if the lock is currently being locked.
|
boolean |
tryLock(String lockName,
Duration acquireTimeout)
Tries to acquire the lock with the given name within the given interval.
|
void |
unlock(String lock,
boolean force)
Unlocks the given lock.
|
boolean tryLock(@Nonnull String lockName, @Nullable Duration acquireTimeout)
lockName
- the name of the lock to acquire.acquireTimeout
- the max time to wait for a lock. Used null to immediatelly return if a lock
cannot
be obtained.boolean isLocked(@Nonnull String lock)
lock
- the name of the lock to checkvoid unlock(String lock, boolean force)
lock
- the name of the lockforce
- true if the lock should be removed, even if it is acquired by another nodeCopyright © 2018. All rights reserved.