|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.locks.LockHelper
Provides an abstraction as the API (Application Programming Interface)
to the lock services. This API includes only class methods and must be
used accordingly. These methods can be categorized as local and remote
invocations. The local methods are getters of information, typically
from cookies, that are held in the client. The remote methods serve as
wrappers to services that promote server-side functionality to clients.
Supported API: true
Extendable: false
Lockable
,
LockService
,
Serialized FormField Summary | |
private static String |
CLASSNAME
|
static long |
EXTERNALIZATION_VERSION_UID
|
static boolean |
LOCKED
An indication, passed to getSearchCondition, to build a search condition to find all locked objects. |
protected static long |
OLD_FORMAT_VERSION_UID
|
private static String |
RESOURCE
|
(package private) static long |
serialVersionUID
|
static LockService |
service
Supported API: true |
static boolean |
UNLOCKED
An indication, passed to getSearchCondition, to build a search condition to find all unlocked objects. |
Constructor Summary | |
LockHelper()
|
Method Summary | |
static Lockable |
assignLock(Lockable object,
WTPrincipalReference locker,
String note)
Assigns a lock on the given lockable object by the given principal. |
static Lockable |
assignLock(Lockable object,
WTPrincipalReference locker,
String note,
Timestamp date)
Assigns a lock on the given lockable object to the given principal, note and date. |
static Timestamp |
getDate(Lockable object)
Gets the time when the object was locked. |
static WTPrincipal |
getLocker(Lockable object)
Gets the principal who placed the lock. |
static WTPrincipalReference |
getLockerReference(Lockable object)
Gets the principal who placed the lock. |
static String |
getNote(Lockable object)
Gets the reason why the object was locked. |
static SearchCondition |
getSearchCondition(Class target,
boolean state)
Gets a SearchCondition to be appended to a query of all the objects that are either locked or unlocked. |
static SearchCondition |
getSearchCondition(Class target,
WTPrincipal principal,
boolean state)
Gets a SearchCondition to be appended to a query of all the objects that are either locked or unlocked for a given principal. |
static SearchCondition |
getSearchCondition(Class target,
WTPrincipalReference principal,
boolean state)
Gets a SearchCondition to be appended to a query of all the objects that are either locked or unlocked for a given principal. |
static boolean |
isLocked(Lockable object)
Tests if the given object has been locked. |
static Lockable |
lock(Lockable object)
Deprecated. Replaced by assignLocker(Lockable,WTPrincipalReference) or LockHelper.service.lock(Lockable) |
static Lockable |
lock(Lockable object,
String note)
Deprecated. Replaced by assignLocker(Lockable,WTPrincipalReference) or LockHelper.service.lock(Lockable,String) |
static Lockable |
lock(Lockable object,
WTPrincipal locker)
Deprecated. Replaced by assignLocker(Lockable,WTPrincipalReference) or LockHelper.service.lock(Lockable,WTPrincipalReference) |
static Lockable |
lock(Lockable object,
WTPrincipal locker,
String note)
Deprecated. Replaced by assignLocker(Lockable,WTPrincipalReference) or LockHelper.service.lock(Lockable,WTPrincipalReference,String) |
void |
readExternal(ObjectInput input)
Reads the non-transient fields of this class from an external source. |
private boolean |
readOldVersion(ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source, which is not the current version. |
protected boolean |
readVersion(LockHelper thisObject,
ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source. |
static Lockable |
releaseLock(Lockable object)
Releases the lock that has been placed on the given lockable object. |
static WTCollection |
releaseLock(WTCollection objectSet)
Releases the lock that has been placed on the given collection of lockable objects. |
static Lockable |
unlock(Lockable object)
Deprecated. Replaced by LockHelper.service.unlock(Lockable) |
static Lockable |
unlock(Lockable object,
WTPrincipal locker)
Deprecated. Replaced by LockHelper.service.unlock(Lockable,WTPrincipalReference) |
void |
writeExternal(ObjectOutput output)
Writes the non-transient fields of this class to an external source. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
public static final boolean LOCKED
public static final boolean UNLOCKED
public static final LockService service
static final long serialVersionUID
public static final long EXTERNALIZATION_VERSION_UID
protected static final long OLD_FORMAT_VERSION_UID
Constructor Detail |
public LockHelper()
Method Detail |
public void writeExternal(ObjectOutput output) throws IOException
writeExternal
in interface Externalizable
output
-
IOException
public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
input
-
IOException
ClassNotFoundException
protected boolean readVersion(LockHelper thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
thisObject
- input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
private boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
public static Lockable lock(Lockable object, WTPrincipal 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.
object
- locker
- note
-
WTException
LockException
WTPropertyVetoException
PersistenceException
wt.locks.LockHelper#assignLocker(Lockable,WTPrincipalReference)
,
wt.locks.LockHelper#service#lock(Lockable,WTPrincipalReference,String)
public static Lockable lock(Lockable object, WTPrincipal locker) throws WTException, LockException, WTPropertyVetoException, PersistenceException
object
- locker
-
WTException
LockException
WTPropertyVetoException
PersistenceException
wt.locks.LockHelper#assignLocker(Lockable,WTPrincipalReference)
,
wt.locks.LockHelper#service#lock(Lockable,WTPrincipalReference,String)
public static Lockable lock(Lockable object, String note) throws WTException, LockException, WTPropertyVetoException, PersistenceException
object
- note
-
WTException
LockException
WTPropertyVetoException
PersistenceException
wt.locks.LockHelper#assignLocker(Lockable,WTPrincipalReference)
,
wt.locks.LockHelper#service#lock(Lockable,WTPrincipalReference,String)
public static Lockable lock(Lockable object) throws WTException, LockException, WTPropertyVetoException, PersistenceException
object
-
WTException
LockException
WTPropertyVetoException
PersistenceException
wt.locks.LockHelper#assignLocker(Lockable,WTPrincipalReference)
,
wt.locks.LockHelper#service#lock(Lockable,WTPrincipalReference,String)
public static Lockable unlock(Lockable object, WTPrincipal locker) throws WTException, LockException, WTPropertyVetoException, PersistenceException
object
- locker
-
WTException
LockException
WTPropertyVetoException
PersistenceException
wt.locks.LockHelper#service#unlock(Lockable,WTPrincipalReference)
public static Lockable unlock(Lockable object) throws WTException, LockException, WTPropertyVetoException, PersistenceException
object
-
WTException
LockException
WTPropertyVetoException
PersistenceException
wt.locks.LockHelper#service#unlock(Lockable)
public static Lockable assignLock(Lockable object, WTPrincipalReference locker, String note) throws WTException, LockException, WTPropertyVetoException
object
- locker
- note
-
WTException
LockException
WTPropertyVetoException
public static Lockable releaseLock(Lockable object) throws WTException, LockException, WTPropertyVetoException
object
-
WTException
LockException
WTPropertyVetoException
public static boolean isLocked(Lockable object) throws LockException
object
-
LockException
public static Timestamp getDate(Lockable object) throws LockException
object
-
LockException
public static String getNote(Lockable object) throws LockException
object
-
LockException
public static WTPrincipal getLocker(Lockable object) throws LockException
object
-
LockException
public static WTPrincipalReference getLockerReference(Lockable object) throws LockException
object
-
LockException
public static SearchCondition getSearchCondition(Class target, boolean state) throws LockException, QueryException
target
- state
-
LockException
QueryException
public static SearchCondition getSearchCondition(Class target, WTPrincipal principal, boolean state) throws WTException, LockException, QueryException
target
- principal
- state
-
WTException
LockException
QueryException
public static SearchCondition getSearchCondition(Class target, WTPrincipalReference principal, boolean state) throws WTException, LockException, QueryException
target
- principal
- state
-
WTException
LockException
QueryException
public static WTCollection releaseLock(WTCollection objectSet) throws WTException, LockException, WTPropertyVetoException
objectSet
-
WTException
LockException
WTPropertyVetoException
releaseLock(Lockable object)
public static Lockable assignLock(Lockable object, WTPrincipalReference locker, String note, Timestamp date) throws WTException, LockException, WTPropertyVetoException
object
- locker
- note
- date
-
WTException
LockException
WTPropertyVetoException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |