|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.arjuna.ats.arjuna.StateManager
com.arjuna.ats.arjuna.coordinator.BasicAction
BasicAction does most of the work of an atomic action, but does not manage thread scoping. This is the responsibility of any derived classes.
| Field Summary | |
protected RecordList |
failedList
|
protected RecordList |
heuristicList
|
protected RecordList |
pendingList
|
protected RecordList |
preparedList
|
protected RecordList |
readonlyList
|
protected boolean |
savedIntentionList
|
| Fields inherited from class com.arjuna.ats.arjuna.StateManager |
modifyingActions, objectName, objectUid, smAttributes, usingActions |
| Constructor Summary | |
|
BasicAction()
|
protected |
BasicAction(int at)
Create a transaction of the specified type. |
|
BasicAction(Uid objUid)
BasicAction constructor with a Uid. |
protected |
BasicAction(Uid u,
int at)
Recreate the specified transaction. |
protected |
BasicAction(Uid u,
int at,
ObjectName objectName)
|
| Method Summary | |
protected int |
Abort()
This is the user callable abort operation. |
protected int |
abortStatus()
|
boolean |
activate()
Overloaded version of activate -- sets up the store, performs read_state followed by restore_state. |
boolean |
activate(java.lang.String root)
Overloaded version of activate -- sets up the store, performs read_state followed by restore_state. |
int |
activeThreads()
|
int |
add(AbstractRecord A)
Add a record to the atomic action. |
boolean |
addChildAction(BasicAction act)
Add a new child action to the atomic action. |
boolean |
addChildThread()
Add the current thread to the list of threads associated with this transaction. |
boolean |
addChildThread(java.lang.Thread t)
Add the specified thread to the list of threads associated with this transaction. |
protected void |
addRecord(AbstractRecord A)
Add the specified abstract record to the transaction. |
protected int |
Begin(BasicAction parentAct)
Atomic action Begin operation. |
protected boolean |
checkForCurrent()
Do we want to check that a transaction can only be terminated by a thread that has it as its current transaction? The base class has this check enabled (i.e., we check), but some implementations may wish to override this. |
java.lang.Object[] |
childTransactions()
|
protected int |
commitStatus()
|
protected void |
criticalEnd()
Defines the end of a critical region by resetting the critical flag. |
protected void |
criticalStart()
Defines the start of a critical region by setting the critical flag. |
static BasicAction |
Current()
|
boolean |
deactivate()
This operation deactivates a persistent object. |
boolean |
destroy()
Overloads StateManager.destroy to prevent destroy being
called on a BasicAction. |
protected int |
doAbort(boolean reportHeuristics,
AbstractRecord record)
|
protected int |
doAbort(RecordList list_toprocess,
boolean reportHeuristics)
|
protected int |
doCommit(boolean reportHeuristics,
AbstractRecord record)
|
protected int |
doCommit(RecordList rl,
boolean reportHeuristics)
Walk down a record list extracting records and calling the appropriate commit function. |
protected int |
doPrepare(boolean reportHeuristics)
|
protected int |
doPrepare(boolean reportHeuristics,
AbstractRecord theRecord)
|
protected int |
End(boolean reportHeuristics)
End the atomic action by committing it. |
boolean |
equals(java.lang.Object obj)
|
void |
finalize()
BasicAction destructor. |
protected boolean |
forgetHeuristics()
Forget any heuristics we may have received, and tell the resources which generated them to forget too. |
protected int |
getHeuristicDecision()
|
ActionHierarchy |
getHierarchy()
Return the action hierarchy for this transaction. |
Uid |
getSavingUid()
|
ObjectStore |
getStore()
Set up an object store and assign it to the currentStore variable. |
int |
hierarchyDepth()
|
protected AbstractRecord |
insertRecord(RecordList reclist,
AbstractRecord record)
|
boolean |
isAncestor(Uid ancestor)
boolean function that checks whether the Uid passed as an argument is the Uid for an ancestor of the current atomic action. |
static boolean |
maintainHeuristics()
If heuristic outcomes are returned, by default we will not save the state once the forget method has been called on them (which happens as soon as we have received all outcomes from registered resources). |
protected void |
onePhaseCommit(boolean reportHeuristics)
There is only one record on the intentions list. |
BasicAction |
parent()
|
protected void |
phase2Abort(boolean reportHeuristics)
Second phase of the two phase commit protocol for aborting actions. |
protected void |
phase2Cleanup()
Cleanup phase for actions. |
protected void |
phase2Commit(boolean reportHeuristics)
Second phase of the two-phase commit protocol for committing actions. |
protected int |
prepare(boolean reportHeuristics)
Phase one of a two phase commit protocol. |
protected int |
preparedStatus()
|
boolean |
preventCommit()
Force the only outcome for the transaction to be to rollback. |
boolean |
removeChildAction(BasicAction act)
Remove a child action. |
boolean |
removeChildThread()
Remove a child thread. |
boolean |
removeChildThread(java.lang.String threadId)
Remove the specified thread from the transaction. |
boolean |
restore_state(InputObjectState os,
int ot)
This assumes the various lists are zero length when it is called. |
boolean |
save_state(OutputObjectState os,
int ot)
Redefined version of save_state and restore_state from StateManager. |
CheckedAction |
setCheckedAction(CheckedAction c)
Add the specified CheckedAction object to this transaction. |
int |
status()
|
ObjectStore |
store()
|
BasicAction |
topLevelAction()
|
Uid |
topLevelActionUid()
The following function returns the Uid of the top-level atomic action. |
java.lang.String |
toString()
Overloads Object.toString() |
java.lang.String |
type()
Overloads StateManager.type() |
int |
typeOfAction()
|
protected void |
updateHeuristic(int p,
boolean commit)
|
protected void |
updateState()
|
| Methods inherited from class com.arjuna.ats.arjuna.StateManager |
attributes, cleanup, deactivate, deactivate, disable, forgetAction, get_uid, getMutex, getStoreRoot, loadObjectState, lockMutex, modified, ObjectType, packHeader, persist, print, rememberAction, setStatus, setupStore, setupStore, terminate, tryLockMutex, unlockMutex, unpackHeader |
| Methods inherited from class java.lang.Object |
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected RecordList pendingList
protected RecordList preparedList
protected RecordList readonlyList
protected RecordList failedList
protected RecordList heuristicList
protected boolean savedIntentionList
| Constructor Detail |
public BasicAction()
public BasicAction(Uid objUid)
protected BasicAction(int at)
protected BasicAction(Uid u,
int at,
ObjectName objectName)
protected BasicAction(Uid u,
int at)
| Method Detail |
public void finalize()
finalize in class StateManagerpublic final ActionHierarchy getHierarchy()
public final boolean preventCommit()
true if successful, false
otherwise.public final int activeThreads()
public final int add(AbstractRecord A)
AddOutcome indicating outcome.public final int hierarchyDepth()
public final boolean isAncestor(Uid ancestor)
true if the parameter represents an ancestor,
false otherwise.public final BasicAction parent()
public final int typeOfAction()
public final int status()
status in class StateManagerpublic ObjectStore getStore()
getStore in class StateManagerObjectStorepublic final ObjectStore store()
public final Uid topLevelActionUid()
Uid.public final BasicAction topLevelAction()
public boolean activate()
null.
activate in class StateManagertrue if successful, false
otherwise.ObjectStorepublic boolean activate(java.lang.String root)
root parameter.
activate in class StateManagertrue if successful, false
otherwise.ObjectStorepublic boolean deactivate()
null. It is assumed that
this is being called during a transaction commit.
deactivate in class StateManagertrue on success, false otherwise.public final boolean addChildThread()
true if successful, false
otherwise.public final boolean addChildThread(java.lang.Thread t)
true if successful, false
otherwise.public final boolean removeChildThread()
true if successful, false
otherwise.public final boolean removeChildThread(java.lang.String threadId)
true if successful, false
otherwise.public final boolean addChildAction(BasicAction act)
true if successful, false
otherwise.public final boolean removeChildAction(BasicAction act)
true if successful, false
otherwise.public final CheckedAction setCheckedAction(CheckedAction c)
CheckedAction.CheckedActionpublic Uid getSavingUid()
public java.lang.String toString()
public boolean save_state(OutputObjectState os,
int ot)
save_state in class StateManagertrue if successful, false
otherwise.
public boolean restore_state(InputObjectState os,
int ot)
restore_state in class StateManagertrue if successful, false
otherwise.public java.lang.String type()
type in class StateManagerpublic static BasicAction Current()
public static boolean maintainHeuristics()
true if the transaction should save its heuristic
information, false otherwise.public boolean destroy()
StateManager.destroy to prevent destroy being
called on a BasicAction. Could be a *very* bad idea!!
destroy in class StateManagerfalse.StateManagerpublic final java.lang.Object[] childTransactions()
public boolean equals(java.lang.Object obj)
protected boolean forgetHeuristics()
true if heuristic information (if any) was
successfully forgotten, false otherwise.protected int Begin(BasicAction parentAct)
ActionStatus indicating outcome.protected int End(boolean reportHeuristics)
true.
ActionStatus indicating outcome.protected int Abort()
ActionStatus indicating outcome.protected final void criticalStart()
protected final void criticalEnd()
protected final void phase2Cleanup()
protected final void phase2Commit(boolean reportHeuristics)
protected final void phase2Abort(boolean reportHeuristics)
protected final int prepare(boolean reportHeuristics)
TwoPhaseOutcome indicating outcome.protected void onePhaseCommit(boolean reportHeuristics)
protected final int getHeuristicDecision()
protected final void addRecord(AbstractRecord A)
protected int preparedStatus()
protected int abortStatus()
protected int commitStatus()
protected int doPrepare(boolean reportHeuristics)
throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException
protected int doPrepare(boolean reportHeuristics,
AbstractRecord theRecord)
throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException
protected int doCommit(RecordList rl,
boolean reportHeuristics)
protected int doCommit(boolean reportHeuristics,
AbstractRecord record)
protected int doAbort(RecordList list_toprocess,
boolean reportHeuristics)
protected int doAbort(boolean reportHeuristics,
AbstractRecord record)
protected AbstractRecord insertRecord(RecordList reclist,
AbstractRecord record)
protected boolean checkForCurrent()
false to disable checking.
protected final void updateHeuristic(int p,
boolean commit)
protected void updateState()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||