|
|||||||||
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.AbstractRecord
com.arjuna.ats.arjuna.PersistenceRecord
com.arjuna.ats.arjuna.CadaverRecord
public class CadaverRecord
Cadaver records are created whenever a persistent object is deleted while still in the scope of an atomic action. This ensures that if the action commits the state of the persistent objects gets properly reflected back in the object store. For objects that are only recoverable such work is unnecessary. Cadaver records replace PersistenceRecords in the record list of an atomic action so they must be merged with such records to enable both commits and aborts to occur.
Field Summary | |
---|---|
protected StateManager |
objectAddr
|
protected OutputObjectState |
state
|
Fields inherited from class com.arjuna.ats.arjuna.PersistenceRecord |
---|
classicPrepare, MAX_OBJECT_SIZE, shadowMade, topLevelState |
Fields inherited from class com.arjuna.ats.arjuna.StateManager |
---|
modifyingActions, objectName, objectUid, smAttributes, usingActions |
Constructor Summary | |
---|---|
protected |
CadaverRecord()
Create a new instance using default values. |
|
CadaverRecord(OutputObjectState os,
ObjectStore objStore,
StateManager sm)
Create a new instance, passing in the object that is being managed. |
Method Summary | |
---|---|
void |
alter(AbstractRecord a)
Alter the current record with the one presented. |
ClassName |
className()
The ClassName representation of this class. |
static AbstractRecord |
create()
Create a new instance of the CadaverRecord, using the default constructor. |
boolean |
doSave()
Override the AbstractRecord.doSave. |
void |
finalize()
Tidy-up the instance. |
protected void |
forgetAction(boolean commit)
|
void |
merge(AbstractRecord mergewith)
merge takes the information from the incoming PersistenceRecord and uses it to initialise the oldState information. |
int |
nestedAbort()
The nested transaction has aborted. |
int |
nestedCommit()
nestedCommit does nothing since the passing of the state up to the parent action is handled by the record list merging system. |
int |
nestedPrepare()
The nested transaction is preparing. |
void |
print(java.io.PrintWriter strm)
Override AbstractRecord.print to write specific information to the specified stream. |
boolean |
propagateOnAbort()
Override default AbstractRecord method. |
void |
setValue(java.lang.Object newState)
|
boolean |
shouldAdd(AbstractRecord a)
Should we add the record presented to the intentions list? |
boolean |
shouldAlter(AbstractRecord a)
Should we alter the current record with the one presented? |
boolean |
shouldMerge(AbstractRecord ar)
Overrides AbstractRecord.shouldMerge |
boolean |
shouldReplace(AbstractRecord ar)
Overrides AbstractRecord.shouldReplace |
int |
topLevelAbort()
The nested transaction has aborted. |
int |
topLevelCommit()
At topLevelCommit we commit the uncommitted version already saved into object store. |
int |
topLevelPrepare()
At topLevelPrepare write uncommitted version into object store. |
java.lang.String |
type()
The type of the class - may be used to save information in an hierarchical manner in the object store. |
int |
typeIs()
The type of the record. |
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.PersistenceRecord |
---|
restore_state, save_state, shadowForced, topLevelCleanup |
Methods inherited from class com.arjuna.ats.arjuna.coordinator.AbstractRecord |
---|
create, equals, forgetHeuristic, getNext, getPrevious, getTypeOfObject, greaterThan, lessThan, nestedCleanup, nestedOnePhaseCommit, order, propagateOnCommit, replace, setNext, setPrevious, topLevelOnePhaseCommit |
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, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected StateManager objectAddr
protected OutputObjectState state
Constructor Detail |
---|
public CadaverRecord(OutputObjectState os, ObjectStore objStore, StateManager sm)
OutputObjectState
- os the state of the object that is being
removed.StateManager
- sm the object being removed.protected CadaverRecord()
Method Detail |
---|
public void finalize()
finalize
in class PersistenceRecord
public boolean propagateOnAbort()
propagateOnAbort
in class AbstractRecord
true
public int typeIs()
typeIs
in class PersistenceRecord
RecordType
public ClassName className()
className
in class PersistenceRecord
ClassName
to identify this abstract record.public int nestedAbort()
TwoPhaseOutcome
to indicate success/failure.TwoPhaseOutcome
public int nestedPrepare()
TwoPhaseOutcome
to indicate success/failure.TwoPhaseOutcome
public int topLevelAbort()
topLevelAbort
in class PersistenceRecord
TwoPhaseOutcome
to indicate success/failure.TwoPhaseOutcome
public int topLevelCommit()
topLevelCommit
in class PersistenceRecord
TwoPhaseOutcome
to indicate success/failure.TwoPhaseOutcome
public int topLevelPrepare()
topLevelPrepare
in class PersistenceRecord
TwoPhaseOutcome
to indicate success/failure.TwoPhaseOutcome
public void print(java.io.PrintWriter strm)
print
in class PersistenceRecord
PrintWriter
- strm the stream to use.public java.lang.String type()
type
in class PersistenceRecord
public boolean doSave()
doSave
in class PersistenceRecord
true
if the object being removed is a persistent
object (RecordType.PERSISTENT). false
otherwise.RecordType
public static AbstractRecord create()
public void merge(AbstractRecord mergewith)
AbstractRecord
- mergewith The record to merge with.public boolean shouldMerge(AbstractRecord ar)
AbstractRecord
- ar the record to potentially merge with.
true
if this instance and the parameter have the
same id (order()) and the parameter is either persistent or recoverable.
false
otherwise.RecordType
public boolean shouldReplace(AbstractRecord ar)
AbstractRecord
- ar the record to potentially replace this
instance.
true
if this instance and the parameter have the
same id (order()) and the parameter is either persistent or recoverable.
false
otherwise.RecordType
public java.lang.Object value()
AbstractRecord
HeuristicInformation
value
in class AbstractRecord
Object
to be used to order.public void setValue(java.lang.Object newState)
setValue
in class AbstractRecord
public int nestedCommit()
nestedCommit
in class AbstractRecord
TwoPhaseOutcome
to indicate success/failure.TwoPhaseOutcome
public void alter(AbstractRecord a)
AbstractRecord
alter
in class AbstractRecord
public boolean shouldAdd(AbstractRecord a)
AbstractRecord
shouldAdd
in class AbstractRecord
true
if the record should be added,
false
otherwise.public boolean shouldAlter(AbstractRecord a)
AbstractRecord
shouldAlter
in class AbstractRecord
true
if the record should be altered,
false
otherwise.protected final void forgetAction(boolean commit)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |