|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.arjuna.ats.arjuna.StateManager com.arjuna.ats.txoj.Lock
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.
Field Summary |
Fields inherited from class com.arjuna.ats.arjuna.StateManager |
modifyingActions, objectName, objectUid, smAttributes, usingActions |
Constructor Summary | |
Lock()
Create a new lock. |
|
Lock(int lm)
Create a new Lock object and initialise it. |
|
Lock(Uid storeUid)
This is used when re-initialising a Lock after retrieval from the object store. |
Method Summary | |
void |
changeHierarchy(ActionHierarchy newOwner)
Change the transaction hierarchy associated with the lock to that provided. |
boolean |
conflictsWith(Lock otherLock)
Implementation of Lock conflict check. |
boolean |
equals(Lock otherLock)
Are the two locks equal? |
boolean |
equals(java.lang.Object otherLock)
Overrides Object.equals() |
void |
finalize()
General clean up as Lock is deleted. |
ActionHierarchy |
getAllOwners()
|
Uid |
getCurrentOwner()
|
int |
getCurrentStatus()
|
protected Lock |
getLink()
Get the next lock in the chain. |
int |
getLockMode()
|
boolean |
modifiesObject()
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. |
void |
print(java.io.PrintWriter strm)
functions inherited from StateManager |
void |
propagate()
Propagate the lock. |
boolean |
restore_state(InputObjectState os,
int ot)
Carefully restore the state of a Lock. |
boolean |
save_state(OutputObjectState os,
int ot)
Save the state of a lock object. |
protected void |
setLink(Lock pointTo)
Set the next lock in the chain. |
java.lang.String |
toString()
Overrides Object.toString() |
java.lang.String |
type()
Overrides StateManager.type() |
Methods inherited from class com.arjuna.ats.arjuna.StateManager |
activate, activate, attributes, cleanup, deactivate, deactivate, deactivate, destroy, disable, forgetAction, get_uid, getMutex, getStore, getStoreRoot, loadObjectState, lockMutex, modified, ObjectType, packHeader, persist, rememberAction, setStatus, setupStore, setupStore, status, terminate, tryLockMutex, unlockMutex, unpackHeader |
Methods inherited from class java.lang.Object |
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Lock()
public Lock(int lm)
public Lock(Uid storeUid)
Method Detail |
public void finalize() throws java.lang.Throwable
finalize
in class StateManager
java.lang.Throwable
public final int getLockMode()
LockMode.READ
.public final Uid getCurrentOwner()
public final ActionHierarchy getAllOwners()
public final int getCurrentStatus()
public final void changeHierarchy(ActionHierarchy newOwner)
public final void propagate()
public boolean modifiesObject()
true
if this lock implies the object's state
will be modified, false
otherwise.public boolean conflictsWith(Lock otherLock)
true
if this lock conflicts with the parameter,
false
otherwise.public boolean equals(java.lang.Object otherLock)
public boolean equals(Lock otherLock)
true
if the locks are equal, false
otherwise.public java.lang.String toString()
public void print(java.io.PrintWriter strm)
print
in class StateManager
public boolean restore_state(InputObjectState os, int ot)
restore_state
in class StateManager
true
if successful, false
otherwise.public boolean save_state(OutputObjectState os, int ot)
save_state
in class StateManager
true
if successful, false
otherwise.public java.lang.String type()
type
in class StateManager
protected Lock getLink()
protected void setLink(Lock pointTo)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |