public interface LockManager
Modifier and Type | Interface and Description |
---|---|
static interface |
LockManager.Junit |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT |
static int |
LOCK_ACQUIRED
This requestor has obtained the given lock
|
static int |
LOCK_ALREADY_HELD
This requestor already owns the given lock
|
static int |
LOCK_HELD_BY_ANOTHER
This requestor does not own the given lock; it is held by another
|
static int |
LOCK_HELD_BY_NOBODY
This lock is not held by any requestor.
|
static java.lang.String |
VERSION |
Modifier and Type | Method and Description |
---|---|
int |
acquireLock(java.lang.String aLockName,
boolean aUnlockOnCommit,
StringMap aInfo)
Attempts to lock against a specific string, returning a specific
return status.
|
void |
changeDBLocksToHazelCastLocks(Database aDB) |
void |
checkRequiredLocks(java.util.Set keyset)
Check that all keys in keyset are locked
|
int |
expireRequestorLocks()
When current requestor times out expire all locks
held by him by moving the expiration date to now
|
java.lang.String |
getLockHandle(StringMap aInstancePage)
Gets the handle that would be used to lock an instance.
|
boolean |
isLockable(java.lang.String aClassName)
Check the definition of the indicated class to see if it supports locking.
|
boolean |
isLocked(StringMap aLockPage,
StringMap aInfo)
Deprecated.
As of version 7.1.9, use
lockExists(String, StringMap) instead. |
boolean |
isLocked(java.lang.String aLockName,
StringMap aInfo)
Deprecated.
As of version 7.1.9, use
lockExists(String, StringMap) instead. |
boolean |
lock(java.lang.String aLockName,
boolean aUnlockOnCommit)
Locks a generic string.
|
boolean |
lock(java.lang.String aLockName,
boolean aUnlockOnCommit,
StringMap aInfo)
Locks a generic string.
|
boolean |
lock(StringMap aInstancePage,
boolean aUnlockOnCommit)
Locks an instance.
|
boolean |
lock(StringMap aInstancePage,
boolean aUnlockOnCommit,
StringMap aInfo)
Locks an instance.
|
int |
lockExists(java.lang.String aLockName,
StringMap aLockInfoReturned)
Check if active lock is held by a user.
|
boolean |
lockOnNode(java.lang.String aLockName)
Obtain a node-level lock, using the given key
|
boolean |
lockOnNode(java.lang.String aLockName,
StringMap aInfo)
Obtain a node-level lock, using the given key
|
int |
removeExpiredLocks(int aDays)
Remove the lock entries, which are going to expire in @param aDays days.
|
boolean |
unlock(java.lang.String aLockName,
boolean aInDifferentRequestor)
Unlocks a generic string.
|
boolean |
unlock(StringMap aInstancePage,
boolean aInDifferentRequestor)
Unlocks a generic string.
|
int |
unlockAllForOperator()
Deprecated.
As of version 6.3, use
unlockForRequestor() instead. |
int |
unlockForRequestor()
Unlocks all locks held by the current requestor.
|
boolean |
unlockOnNode(java.lang.String aLockName,
boolean aInDifferentRequestor)
Release a node-level lock
|
int |
unlockOnNodeForRequestor()
Release all of the node-level locks for the given requestor.
|
static final java.lang.String VERSION
static final java.lang.String COPYRIGHT
static final int LOCK_ACQUIRED
static final int LOCK_ALREADY_HELD
static final int LOCK_HELD_BY_ANOTHER
static final int LOCK_HELD_BY_NOBODY
boolean lock(StringMap aInstancePage, boolean aUnlockOnCommit) throws DatabaseException
aInstancePage
- the page containing the instance to lockaUnlockOnCommit
- whether we should unlock the page
when the current transcation is committedDatabaseException
- if something goes wrongboolean lock(StringMap aInstancePage, boolean aUnlockOnCommit, StringMap aInfo) throws DatabaseException
aInstancePage
- the page containing the instance to lockaUnlockOnCommit
- whether we should unlock the page
when the current transcation is committedaInfo
- if the lock attempt is unsuccessful, this is filled in with
information about the attempt. The value of
ErrorMessage
is the name of a Rule-Message
that describes the problem. In addition, these other keys might be
set
pxOwnerId
pxExpireDateTime
pxUpdateOperator
pxUpdateOpName
pxLockHandle
DatabaseException
- if something goes wrongboolean lock(java.lang.String aLockName, boolean aUnlockOnCommit) throws DatabaseException
aLockName
- the string to lockaUnlockOnCommit
- whether we should unlock
when the current transcation is committedDatabaseException
- if something goes wrongboolean lock(java.lang.String aLockName, boolean aUnlockOnCommit, StringMap aInfo) throws DatabaseException
aLockName
- the string to lockaUnlockOnCommit
- whether we should unlock
when the current transcation is committedaInfo
- a StringMap to fill in with owner and expiration info
from an existing lock. This is only filled
in when lock() returns false.DatabaseException
- if something goes wrongint acquireLock(java.lang.String aLockName, boolean aUnlockOnCommit, StringMap aInfo) throws DatabaseException
aLockName
- the string to lockaUnlockOnCommit
- whether we should unlock
when the current transcation is committedaInfo
- if the lock attempt is unsuccessful, this is filled in with
information about the attempt. The value of
ErrorMessage
is the name of a Rule-Message
that describes the problem. In addition, these other keys might be
set
pxOwnerId
pxExpireDateTime
pxUpdateOperator
pxUpdateOpName
pxLockHandle
LOCK_ACQUIRED
, LOCK_ALREADY_HELD
, LOCK_HELD_BY_ANOTHER
DatabaseException
- if something goes wrongint expireRequestorLocks() throws DatabaseException
DatabaseException
- if there is a database problemvoid checkRequiredLocks(java.util.Set keyset) throws DatabaseException
keyset
- - Set of key strings to checkDatabaseException
boolean unlock(StringMap aInstancePage, boolean aInDifferentRequestor) throws DatabaseException
aInstancePage
- the page containing the instance to unlockaInDifferentRequestor
- if true, then the instance is unlocked even if it is in a
different requestorDatabaseException
- if something goes wrongboolean unlock(java.lang.String aLockName, boolean aInDifferentRequestor) throws DatabaseException
aLockName
- the string to unlockaInDifferentRequestor
- if true, then the instance is unlocked even if it is in a
different requestorDatabaseException
- if something goes wrongint unlockAllForOperator() throws DatabaseException
unlockForRequestor()
instead.DatabaseException
- if something goes wrongint unlockForRequestor() throws DatabaseException
DatabaseException
- if something goes wrongjava.lang.String getLockHandle(StringMap aInstancePage) throws DatabaseException
aInstancePage
- the page containing the instancenull
if this page's class
does not allow lockingBadInputException
- if aInstancePage
is not a valid instance pageBadClassDefinitionException
- if
aInstancePage
has a bad instance class (pxObjClass
)DatabaseException
- if something goes wrongboolean lockOnNode(java.lang.String aLockName)
aLockName
- the string to lock onboolean lockOnNode(java.lang.String aLockName, StringMap aInfo)
aLockName
- the string to lock onaInfo
- if the lock is unsuccessful, this is filled in with
information about the attempt. The value of
ErrorMessage
is the name of a Rule-Message
that describes the problem. In addition, these other keys might be
set
pxOwnerId
pxExpireDateTime
pxUpdateOperator
pxUpdateOpName
pxLockHandle
boolean unlockOnNode(java.lang.String aLockName, boolean aInDifferentRequestor)
aLockName
- the string to lock onaInDifferentRequestor
- int unlockOnNodeForRequestor()
boolean isLockable(java.lang.String aClassName) throws BadClassDefinitionException
aClassName
- name of the class to checktrue
if the class allows locking, false>/code> otherwise.
BadClassDefinitionException
- if the aClassName parameter is blank or null.boolean isLocked(StringMap aLockPage, StringMap aInfo) throws DatabaseException
lockExists(String, StringMap)
instead.aLockPage
- the page of the instance to be locked on.aInfo
- a Map object which will be populated when lock info is available.
This object will be populated when either the lock is refreshed (because
the current requestor owns it) or the lock is held by some other requestorDatabaseException
- when a problem occurs manipulating the locksboolean isLocked(java.lang.String aLockName, StringMap aInfo) throws DatabaseException
lockExists(String, StringMap)
instead.aLockName
- the string to be locked on.aInfo
- a Map object which will be populated when lock info is available.
This object will be populated when either the lock is refreshed (because
the current requestor owns it) or the lock is held by some other requestorDatabaseException
- when a problem occurs manipulating the locksint lockExists(java.lang.String aLockName, StringMap aLockInfoReturned) throws LockFailureException
aLockName
- the string to be locked onaLockInfoReturned
- the Map object which will be populated when lock info is available.
This object will not be populated if no users hold the lock.LOCK_ALREADY_HELD
, LOCK_HELD_BY_ANOTHER
, LOCK_HELD_BY_NOBODY
LockFailureException
void changeDBLocksToHazelCastLocks(Database aDB)
int removeExpiredLocks(int aDays)
aDays
- Days to purgeCopyright © 2018 Pegasystems Inc. All Rights Reserved.