public class SQLLockManager extends BasicLockManager
Constructor and Description |
---|
SQLLockManager() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
acquireLock(String lockName)
Actually obtains a lock and returns immediatelly.
|
protected int |
getInitialWait()
If the lock is already aquired, this returns the initial amount of milliseconds to wait.
|
List<LockInfo> |
getLocks()
Returns the list of known locks.
|
protected int |
getMaxWait()
Returns the maximal interval in millis which is spent until a new attempt is made to acquire a lock.
|
String |
getName() |
protected int |
getWaitIncrement()
If the lock is still acquired, this returns the amount of milliseconds to increase the wait interval.
|
boolean |
isLocked(String lock)
Determines if the lock is currently being locked.
|
void |
unlock(String lock,
boolean force)
Unlocks the given lock.
|
tryLock
protected int getMaxWait()
BasicLockManager
getMaxWait
in class BasicLockManager
protected int getWaitIncrement()
BasicLockManager
getWaitIncrement
in class BasicLockManager
protected int getInitialWait()
BasicLockManager
getInitialWait
in class BasicLockManager
protected boolean acquireLock(@Nonnull String lockName)
BasicLockManager
acquireLock
in class BasicLockManager
lockName
- the name of the lock to acquire.public boolean isLocked(@Nonnull String lock)
LockManager
lock
- the name of the lock to checkpublic void unlock(String lock, boolean force)
LockManager
lock
- the name of the lockforce
- true if the lock should be removed, even if it is acquired by another nodepublic List<LockInfo> getLocks()
LockManager
Copyright © 2018. All rights reserved.