public interface KKLockMgrIf
Modifier and Type | Method and Description |
---|---|
boolean |
acquire(java.lang.String lockName)
Acquire a lock.
|
boolean |
acquire(java.lang.String lockName,
int sleepMS,
int timeoutMS)
Acquire a lock.
|
void |
refreshConfigs()
Refresh the configuration of the manager
|
void |
release(java.lang.String lockName)
Release a lock for the specified object.
|
boolean acquire(java.lang.String lockName) throws com.konakart.app.KKException
Guarantees to return a lock for the specified object (if locking is enabled).
It will sleep and retry until the timeout at which point it will remove any existing lock and acquire it for the current thread.
If locking is disabled this will return false without doing anything. The enabled/disabled state is set by the konakart.lockAPIs.enabled property in konakart.properties.
The sleep quantity is defined by the konakart.lockAPIs.sleepMS property in konakart.properties.
The timeout quantity is defined by the konakart.lockAPIs.timeoutMS property in konakart.properties.
lockName
- the name of the object to acquire the lock for. Use any String less than 32
characters in length.com.konakart.app.KKException
- an unexpected KKException exceptionboolean acquire(java.lang.String lockName, int sleepMS, int timeoutMS) throws com.konakart.app.KKException
Guarantees to return a lock for the specified object (if locking is enabled).
It will sleep and retry until the timeout at which point it will remove any existing lock and acquire it for the current thread.
If locking is disabled this will return false without doing anything. The enabled/disabled state is set by the konakart.lockAPIs.enabled property in konakart.properties.
lockName
- the name of the object to acquire the lock for. Use any String less than 32
characters in length.sleepMS
- number of milliseconds to sleep between attempts to acquire the locktimeoutMS
- number of milliseconds to wait before forcibly acquiring the lockcom.konakart.app.KKException
- an unexpected KKException exceptionvoid release(java.lang.String lockName) throws com.konakart.app.KKException
lockName
- the name of the object to release the lock oncom.konakart.app.KKException
- an unexpected KKException exceptionvoid refreshConfigs() throws com.konakart.app.KKException
com.konakart.app.KKException
- an unexpected KKException exceptionCopyright © 2018 DS Data Systems UK Ltd.