|
||||||||||
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.arjuna.coordinator.AbstractRecord
Abstract Record Class This class provides an abstract template that defines the interface that the atomic action system uses to notify objects that various state transitions have occurred as the 2PC protocol executes. Record types derived from this class manage certain properties of objects such as recovery information, concurrency control information etc, and all must redifine the operations defined here as abstract to take appropriate action. Many functions are declared pure virtual to force a definition to occur in any derived class. These are currently all functions dealing with atomic action coordination as well as the following list management functions: typeIs: returns the record type of the instance. This is one of the values of the enumerated type Record_type value: Some arbitrary value associated with the record instance merge: Used when two records need to merge togethor. Currently this is only used by CadaverRecords to merge information from PersistenceRecords shouldAdd: returns TRUE is the record should be added to the list FALSE if it should be discarded shouldMerge: returns TRUE is the two records should be merged into a single record, FALSE if it should be discarded shouldReplace: returns TRUE if the record should replace an existing one, FALSE otherwise.
Field Summary |
Fields inherited from class com.arjuna.ats.arjuna.StateManager |
modifyingActions, objectName, objectUid, smAttributes, usingActions |
Constructor Summary | |
protected |
AbstractRecord()
Creates a 'blank' abstract record. |
protected |
AbstractRecord(Uid storeUid)
Create a new instance with the specified paramaters. |
protected |
AbstractRecord(Uid storeUid,
java.lang.String objType,
int otype)
Create a new instance with the specified paramaters. |
Method Summary | |
abstract void |
alter(AbstractRecord a)
Alter the current record with the one presented. |
ClassName |
className()
Only used for crash recovery, so most records don't need it. |
static AbstractRecord |
create(ClassName cName)
|
boolean |
doSave()
Should this record be saved in the intentions list? If the record is saved, then it may be recovered later in the event of a failure. |
boolean |
equals(AbstractRecord ar)
Determine if two records are equal in that both are the same type and have the same order value (determined via 'order()'). |
boolean |
forgetHeuristic()
Forget any heuristic outcome which this implementation may have produced. |
protected AbstractRecord |
getNext()
|
protected AbstractRecord |
getPrevious()
These few functions are link manipulation primitives used by the RecordList processing software to chain instances together. |
java.lang.String |
getTypeOfObject()
Return the type of the abstract record. |
boolean |
greaterThan(AbstractRecord ar)
Determine if two records are greater than in that both are the same type and their Uids are greater than. |
boolean |
lessThan(AbstractRecord ar)
Determine if two records are less than in that both are the same type and their Uids are less than. |
abstract void |
merge(AbstractRecord a)
Merge the current record with the one presented. |
abstract int |
nestedAbort()
A rollback of a nested transaction has occurred. |
int |
nestedCleanup()
Cleanup is called if a nested is detected to be an orphan. |
abstract int |
nestedCommit()
A commit of a nested transaction has occurred. |
int |
nestedOnePhaseCommit()
Perform a nested one phase commit. |
abstract int |
nestedPrepare()
A prepare for a nested transaction has occurred. |
Uid |
order()
Return the Uid of this abstract record so that it can be ordered in the intentions list. |
void |
print(java.io.PrintWriter strm)
Write information about this specific instance to the specified stream. |
boolean |
propagateOnAbort()
Determine if records are discarded on action abort or must be propagated to parents. |
boolean |
propagateOnCommit()
Determine if records are discarded on action commit or must be propagated to parents. |
void |
replace(AbstractRecord a)
The current record is about to replace the one presented. |
boolean |
restore_state(InputObjectState os,
int i)
During recovery, the transaction log is given to the recovery system and it will recreate a transaction instance to perform necessary recovery actions. |
boolean |
save_state(OutputObjectState os,
int i)
When the transaction is required to make the intentions list persistent, it scans the list and asks each record whether or not it requires state to be saved (by calling doSave). |
protected void |
setNext(AbstractRecord ar)
Set the next element in the list to the specified instance. |
protected void |
setPrevious(AbstractRecord ar)
Set the previous element in the list to the specified instance. |
abstract void |
setValue(java.lang.Object o)
|
abstract boolean |
shouldAdd(AbstractRecord a)
Should we add the record presented to the intentions list? |
abstract boolean |
shouldAlter(AbstractRecord a)
Should we alter the current record with the one presented? |
abstract boolean |
shouldMerge(AbstractRecord a)
Should we merge the current record with the one presented? |
abstract boolean |
shouldReplace(AbstractRecord a)
Should we replace the record presented with the current record? |
abstract int |
topLevelAbort()
A rollback of a top-level transaction has occurred. |
int |
topLevelCleanup()
Cleanup is called if a top-level action is detected to be an orphan. |
abstract int |
topLevelCommit()
A commit of a top-level transaction has occurred. |
int |
topLevelOnePhaseCommit()
Perform a top-level one phase commit. |
abstract int |
topLevelPrepare()
A prepare for a top-level transaction has occurred. |
java.lang.String |
type()
Re-implementation of abstract methods inherited from base class. |
abstract int |
typeIs()
|
abstract java.lang.Object |
value()
If this abstract record caused a heuristic then it should return an object which implements HeuristicInformation |
Methods inherited from class com.arjuna.ats.arjuna.StateManager |
activate, activate, attributes, cleanup, deactivate, deactivate, deactivate, destroy, disable, finalize, 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, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected AbstractRecord(Uid storeUid, java.lang.String objType, int otype)
ObjectType
protected AbstractRecord(Uid storeUid)
protected AbstractRecord()
Method Detail |
public abstract int typeIs()
RecordType
value.public abstract java.lang.Object value()
HeuristicInformation
Object
to be used to order.public abstract void setValue(java.lang.Object o)
public ClassName className()
ClassName
to identify this abstract record.public abstract int nestedAbort()
TwoPhaseOutcome
to indicate success/failure.TwoPhaseOutcome
public abstract int nestedCommit()
TwoPhaseOutcome
to indicate success/failure.TwoPhaseOutcome
public abstract int nestedPrepare()
TwoPhaseOutcome
to indicate success/failure.TwoPhaseOutcome
public abstract int topLevelAbort()
TwoPhaseOutcome
to indicate success/failure.TwoPhaseOutcome
public abstract int topLevelCommit()
TwoPhaseOutcome
to indicate success/failure.TwoPhaseOutcome
public abstract int topLevelPrepare()
TwoPhaseOutcome
to indicate success/failure.TwoPhaseOutcome
public Uid order()
Uid for this instance.- See Also:
Uid
public java.lang.String getTypeOfObject()
String
representing type.public boolean propagateOnAbort()
true
if the record should be propagated to the
parent transaction if the current transaction rolls back,
false
otherwise. The default is false
.public boolean propagateOnCommit()
true
if the record should be propagated to the
parent transaction if the current transaction commits,
false
otherwise. The default is true
.public final boolean equals(AbstractRecord ar)
true
if equal, false
otherwise.public final boolean lessThan(AbstractRecord ar)
true
if equal, false
otherwise.public final boolean greaterThan(AbstractRecord ar)
true
if equal, false
otherwise.public int topLevelCleanup()
TwoPhaseOutcome
as default is the same as
topLevelAbort.public int nestedCleanup()
TwoPhaseOutcome
as default is the same as
nestedAbort.public boolean doSave()
true
if it should be saved, false
otherwise. false
is the default.public java.lang.String type()
type
in class StateManager
public void print(java.io.PrintWriter strm)
print
in class StateManager
public boolean save_state(OutputObjectState os, int i)
save_state
in class StateManager
true
if successful, false
otherwise.public boolean restore_state(InputObjectState os, int i)
restore_state
in class StateManager
true
if successful, false
otherwise.public boolean forgetHeuristic()
true
by default. If false
is
returned then the instance must be remembered by the transaction
(in the log) in order for recovery to retry later or for a system
administrator to be able to determine which resources have not
been successfully completed.public int nestedOnePhaseCommit()
TwoPhaseOutcome
to indicate success/failure.TwoPhaseOutcome
public int topLevelOnePhaseCommit()
TwoPhaseOutcome
to indicate success/failure.TwoPhaseOutcome
public static AbstractRecord create(ClassName cName)
ClassName
public abstract void merge(AbstractRecord a)
public abstract void alter(AbstractRecord a)
public abstract boolean shouldAdd(AbstractRecord a)
true
if the record should be added,
false
otherwise.public abstract boolean shouldAlter(AbstractRecord a)
true
if the record should be altered,
false
otherwise.public abstract boolean shouldMerge(AbstractRecord a)
true
if the record should be merged,
false
otherwise.public abstract boolean shouldReplace(AbstractRecord a)
true
if the record should be replaced,
false
otherwise.public void replace(AbstractRecord a)
protected final AbstractRecord getPrevious()
protected final AbstractRecord getNext()
protected final void setPrevious(AbstractRecord ar)
protected final void setNext(AbstractRecord ar)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |