|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectwt.services.StandardManager
wt.locks.StandardLockService
public class StandardLockService
Provides an abstraction of the standard implementation of server-side functionality as defined by the LockService interface. This class can be augmented and/or extended to enhance functionality.
As defined by the standard locking service's access control rules, when attempting to lock an object if it is not already locked and the given principal has modify access to the object then it is locked. When attempting to unlock an object if it is already locked and the given principal has administrative access, or is the given principal is the one who originally placed the lock and has modify access to the object then it is unlocked. Otherwise, an exception is thrown indicating the failure. Additionally, when a lock is placed on an object by a principal, that user or group is the only agency able to then modify the object while it's in a locked state.
Event-based processing is performed on business objects asserted as being lockable during [preparation for] database modifications and full restorations. When a business object is [prepared for] being modified in the database this class listens to a dispatched event indicating that the modify is about to commence and vetoes it if the business object is locked and the current session's principal is not the one who originally placed the lock. Otherwise, the modification is allowed to take place. So it is valid to modify a business object that's lockable if it isn't locked. When a business object is being fully restored from the database this class listens to a dispatched event indicating that the full restoration is commencing and restores the lock cookie's locker reference.
If the standard implementation is not desired then a custom implementation can extend from LockService alongside the standard implementation, and be used as the default locking service.
Use the newStandardLockService static factory method(s),
not the StandardLockService constructor, to construct instances
of this class. Instances must be constructed using the static factory(s),
in order to ensure proper initialization of the instance.
Supported API: true
Extendable: false
StandardManager,
LockServiceEvent,
wt.fc.PersistenceManagerEvent.PREPARE_FOR_MODIFICATION,
wt.fc.PersistenceManagerEvent.PRE_MODIFY,
wt.fc.PersistenceManagerEvent.FULL_RESTORE,
Serialized Form| Method Summary | |
|---|---|
Lockable |
lock(Lockable object)
Defaults the note to be null, the principal to be null, which makes the principal the session's user, and invokes the main lock method. |
Lockable |
lock(Lockable object,
String note)
Defaults the principal to be null, which makes the principal the session's user, and invokes the main lock method. |
Lockable |
lock(Lockable object,
WTPrincipalReference locker)
Defaults the note to be null and invokes the main lock method. |
Lockable |
lock(Lockable object,
WTPrincipalReference locker,
String note)
Provides server-side functionality for the locking of business objects. |
Lockable |
unlock(Lockable object)
Defaults the principal to be null, which makes the principal the session's user, and invokes the main unlock method. |
Lockable |
unlock(Lockable object,
WTPrincipalReference locker)
Provides server-side functionality for releasing a business object's lock. |
| Methods inherited from class wt.services.StandardManager |
|---|
getManagerService, getManagerStatus, getName, getStartupType |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public Lockable lock(Lockable object,
WTPrincipalReference locker,
String note)
throws WTException,
LockException,
WTPropertyVetoException,
PersistenceException
However, if an object is lockable but has not yet been locked, then any agency has unrestricted access to the object until it has been locked.
lock in interface LockServiceobject - locker - note -
WTException
LockException
WTPropertyVetoException
PersistenceException
public Lockable lock(Lockable object,
WTPrincipalReference locker)
throws WTException,
LockException,
WTPropertyVetoException,
PersistenceException
lock in interface LockServiceobject - locker -
WTException
LockException
WTPropertyVetoException
PersistenceExceptionLockService.lock(Lockable,WTPrincipalReference,String)
public Lockable lock(Lockable object,
String note)
throws WTException,
LockException,
WTPropertyVetoException,
PersistenceException
lock in interface LockServiceobject - note -
WTException
LockException
WTPropertyVetoException
PersistenceExceptionLockService.lock(Lockable,WTPrincipalReference,String)
public Lockable lock(Lockable object)
throws WTException,
LockException,
WTPropertyVetoException,
PersistenceException
lock in interface LockServiceobject -
WTException
LockException
WTPropertyVetoException
PersistenceExceptionLockService.lock(Lockable,WTPrincipalReference,String)
public Lockable unlock(Lockable object,
WTPrincipalReference locker)
throws WTException,
LockException,
WTPropertyVetoException,
PersistenceException
unlock in interface LockServiceobject - locker -
WTException
LockException
WTPropertyVetoException
PersistenceException
public Lockable unlock(Lockable object)
throws WTException,
LockException,
WTPropertyVetoException,
PersistenceException
unlock in interface LockServiceobject -
WTException
LockException
WTPropertyVetoException
PersistenceExceptionLockService.unlock(Lockable,WTPrincipalReference)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||