Instances of this class (or derived user classes) are used when trying to set
a lock. The default implementation provides a single-write/multiple-reader
policy. However, by overridding the appropriate methods, other, type-specific
concurrency control locks can be implemented.
- Mark Little (email@example.com)
- $Id: Lock.java 2342 2006-03-30 13:06:17Z $
- JTS 1.0.
Create a new Lock object and initialise it. Mode is based upon argument.
The value of BasicAction.Current determines the values of the remainder
of the fields. If there is no action running the owner field is set to be
the application uid created when the application starts.
int currentPid = Utility.getpid();
This is used when re-initialising a Lock after retrieval from the object
General clean up as Lock is deleted.
- the mode this lock is currently in, e.g.,
- the identity of the lock's current owner (the transaction id).
- the transaction hierarchy associated with this lock.
- the lock's current status.
Change the transaction hierarchy associated with the lock to that
Does this lock imply a modification of the object it is applied to? For
example, a READ lock would return false, but a WRITE lock would return
true if this lock implies the object's state will be
Implementation of Lock conflict check. Returns TRUE if there is conflict
FALSE otherwise. Does not take account of relationship in the atomic
action hierarchy since this is a function of LockManager.
true if this lock conflicts with the parameter,
txojLogger.logger.trace("Lock::conflictsWith(" + otherLock + ")\n" + "\tLock 1:\n"
+ this + "\n" + "\tLock 2:\n" + otherLock);
if (otherLock instanceof Lock)
Are the two locks equal?
true if the locks are equal,
+ otherLock + ")\n" + "\tLock 1:\n" + this + "\n"
+ "\tLock 2:\n" + otherLock);
strm.write("Lock object : \n");
strm.write("\tcurrent_status : "
strm.write("\n\tOwner List : \n");
functions inherited from StateManager
Carefully restore the state of a Lock.
true if successful,
Save the state of a lock object.
true if successful,
Get the next lock in the chain.
Set the next lock in the chain.
private static int applicPid = com.arjuna.ats.arjuna.utils.Utility.getpid();