public interface LockManager extends IOEventListener
Modifier and Type | Method and Description |
---|---|
IOTransaction |
breakAndLock(IOObject object,
IOLockKeeper keeper)
This method will break the existing lock on an object, and re-lock
it.
|
IOTransaction |
breakAndLock(List<String> pLockHandles,
IOLockKeeper keeper) |
boolean |
breakLock(IOHashKey key)
This method is similar to 'breakAndLock', except that it will not
re-lock the object.
|
boolean |
breakLock(IOObject object)
This method is similar to 'breakAndLock', except that it will not
re-lock the object.
|
LockInfo |
getLockInfoFromIdentifier(IOHashKey key) |
LockInfo |
getLockInfoFromIdentifier(IOObject object) |
IOLockKeeper |
getLockKeeper(IOHashKey key)
Get a reference to the lock keeper for an object.
|
IOLockKeeper |
getLockKeeper(IOObject object)
Get a reference to the lock keeper for an object.
|
boolean |
isActive(IOTransaction trans)
Checks whether or not the given transaction is active.
|
boolean |
isLocked(IOHashKey key)
Check if an object is locked
|
boolean |
isLocked(IOObject object)
Check if an object is locked
|
IOTransaction |
lock(IOObject object,
IOLockKeeper keeper)
Aquire a lock on an object.
|
IOTransaction |
lock(IOObject pObject,
List<String> pLockHandles,
IOLockKeeper pLockKeeper)
Acquire a lock on the provided
IOObject using the provided lockhandles. |
IOTransaction |
lock(List<String> pLockHandles,
IOLockKeeper pLockKeeper) |
void |
refreshLock(IOTransaction object)
This method will refresh a lock when an object changes id.
|
boolean |
release(IOTransaction object)
Release the lock on an object.
|
handleEvent
IOTransaction lock(IOObject object, IOLockKeeper keeper) throws IllegalArgumentException, IllegalOperationException
breakLock(neo.xredsys.api.IOObject)
or breakAndLock(neo.xredsys.api.IOObject, neo.xredsys.api.IOLockKeeper)
will generate a notification to the existing
LockKeeper.object
- the object to be lockedkeeper
- a lock keeper to notify if the object's lock is
broken; if keeper is null, no notification will be
given on a broken lockIllegalArgumentException
- if object is nullIllegalOperationException
- if the object is already locked, or if the object couldn't create an IOTransaction objectIOTransaction lock(List<String> pLockHandles, IOLockKeeper pLockKeeper) throws IllegalArgumentException, IllegalOperationException
IOTransaction lock(IOObject pObject, List<String> pLockHandles, IOLockKeeper pLockKeeper) throws IllegalArgumentException, IllegalOperationException
IOObject
using the provided lockhandles. Locking the object will fail
if one or more of the lockhandles are already locked by someone else.pObject
- the object to lock. The object may not be nullpLockHandles
- zero or more lockhandlespLockKeeper
- a lock keeper to notify if the object's lock is broken; if keeper is null, no notification will be
given on a broken lockIOTransaction
if locking the object succeededIllegalArgumentException
- if the object is nullIllegalOperationException
- if locking the object failedvoid refreshLock(IOTransaction object)
object
- the object whose lock to refreshIOTransaction breakAndLock(IOObject object, IOLockKeeper keeper) throws IllegalArgumentException, IllegalOperationException
object
- the object to be lockedkeeper
- a lock keeper to notify if the object's lock is brokenIllegalArgumentException
- if object is nullIllegalOperationException
- if object is a new object that doesn't exist in the databaseIOTransaction breakAndLock(List<String> pLockHandles, IOLockKeeper keeper) throws IllegalArgumentException, IllegalOperationException
boolean breakLock(IOObject object) throws IllegalArgumentException, IllegalOperationException
object
- the object that will be unlockedIllegalArgumentException
- if object is nullIllegalOperationException
- if the object isn't locked, or the object is new.boolean breakLock(IOHashKey key) throws IllegalArgumentException, IllegalOperationException
key
- the object that will be unlockedIllegalArgumentException
- if object is nullIllegalOperationException
- if the object isn't locked.boolean release(IOTransaction object) throws IllegalOperationException
object
- the object to releaseIllegalArgumentException
- if object is nullIllegalOperationException
- if object is not the IOTransaction that was returned by lock or breakAndLockIOLockKeeper getLockKeeper(IOObject object)
IOLockKeeper getLockKeeper(IOHashKey key)
boolean isLocked(IOObject object)
boolean isLocked(IOHashKey key)
boolean isActive(IOTransaction trans)
trans
- the transaction to check© 1998- 2018 Stibo DX