public interface LockManager
LockManager
interface provides in memory locking services via its lock(String, String)
and
unlock(String, String)
methods.
The LockManager is accessed using EbaseSystem.getLockManager()
.
Modifier and Type | Method and Description |
---|---|
boolean |
isLockHeld(java.lang.String resourceName,
java.lang.String id)
Returns true if the lock is held by another user, returns false if no lock exists or the lock is held by the user
associated with the current thread.
|
boolean |
lock(java.lang.String resourceName,
java.lang.String id)
Locks the specified resource id so that it cannot be accessed by another user, returns
false if
the lock could not be obtained because it's held by another user, otherwise returns true . |
void |
unlock(java.lang.String resourceName,
java.lang.String id)
Unlocks the specified resource id so that it can be accessed by another user.
|
boolean lock(java.lang.String resourceName, java.lang.String id)
false
if
the lock could not be obtained because it's held by another user, otherwise returns true
.
The unlock(String, String)
method should be used to release the lock when it's no longer required.
Locks are held in memory and are not persisted in any way; they are therefore not maintained across
a server restart, or in a clustered environment.
The system releases locks automatically when a form ends by the user navigating to the special final page,
or when WebForm.gotoForm(String, java.util.Map)
or WebForm.gotoUrl(String, java.util.Map)
are called.
In all other circumstances, locks must be explicitly released.
resourceName
- resource name, can be any string of meaning to the calling programid
- resource id, can be any string of meaning to the calling programunlock(String, String)
void unlock(java.lang.String resourceName, java.lang.String id)
resourceName
- resource name, can be any string of meaning to the calling programid
- resource id, can be any string of meaning to the calling programlock(String, String)
boolean isLockHeld(java.lang.String resourceName, java.lang.String id)
resourceName
- resource name, can be any string of meaning to the calling programid
- resource id, can be any string of meaning to the calling program