public interface LockManager extends Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
acquireLockDefault()
Tries to acquire the default lock regardless who is the current owner.
|
void |
close() |
void |
ensureLockDefault()
Tries to refresh the default lock when the current LockChecker has the lock or , when the lock
is expired, is the last owner
|
String |
getDefaultKey() |
long |
getLockTryFrequency() |
String |
getOwner() |
boolean |
isLockHeld() |
boolean |
isReleaseStarted() |
void |
releaseLockDefault()
Release the default lock when is acquired by the current LockChecker.
|
String getDefaultKey()
void acquireLockDefault()
throws LockCheckException
Tries to acquire the default lock regardless who is the current owner.
If the lock is already acquired by the current LockChecker or is expired, will be updated
In case the lock is acquired by another LockChecker, it will wait until the current lock is expired and will try to acquire it again. This will be repeated as many times as (maxTries - 1)
LockCheckException - if the lock cannot be acquiredvoid ensureLockDefault()
throws LockCheckException
Tries to refresh the default lock when the current LockChecker has the lock or , when the lock is expired, is the last owner
Notice that it does not try to acquire when is acquired by another LockChecker
LockCheckException - if, in case of needed, the lock cannot be refreshedvoid releaseLockDefault()
Release the default lock when is acquired by the current LockChecker.
When the lock is not acquired by the current LockChecker, it won't make any change. Does not throw any exception neither.
Idempotent operation.
boolean isReleaseStarted()
long getLockTryFrequency()
String getOwner()
boolean isLockHeld()
void close()
close in interface AutoCloseableclose in interface CloseableCopyright © 2022. All rights reserved.