com.arjuna.ats.arjuna
Class DisposeRecord

java.lang.Object
  extended by com.arjuna.ats.arjuna.StateManager
      extended by com.arjuna.ats.arjuna.coordinator.AbstractRecord
          extended by com.arjuna.ats.arjuna.PersistenceRecord
              extended by com.arjuna.ats.arjuna.CadaverRecord
                  extended by com.arjuna.ats.arjuna.DisposeRecord

public class DisposeRecord
extends CadaverRecord


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, smAttributes, usingActions
 
Constructor Summary
protected DisposeRecord()
           
  DisposeRecord(ObjectStore objStore, StateManager sm)
           
 
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()
           
 boolean doSave()
          Override the AbstractRecord.doSave.
 void finalize()
          Tidy-up the instance.
protected  void forgetAction(boolean commit)
           
 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.
 boolean restore_state(InputObjectState os, int ot)
          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 ot)
          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).
 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 a)
          Overrides AbstractRecord.shouldMerge
 boolean shouldReplace(AbstractRecord a)
          Overrides AbstractRecord.shouldReplace
 int topLevelAbort()
          The nested transaction has aborted.
 int topLevelCommit()
          At topLevelCommit we remove the state from the 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.CadaverRecord
merge
 
Methods inherited from class com.arjuna.ats.arjuna.PersistenceRecord
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

objectAddr

protected StateManager objectAddr

state

protected OutputObjectState state
Constructor Detail

DisposeRecord

public DisposeRecord(ObjectStore objStore,
                     StateManager sm)

DisposeRecord

protected DisposeRecord()
Method Detail

finalize

public void finalize()
Description copied from class: CadaverRecord
Tidy-up the instance.

Overrides:
finalize in class CadaverRecord

propagateOnAbort

public boolean propagateOnAbort()
Description copied from class: CadaverRecord
Override default AbstractRecord method. CadaverRecords are propagated regardless of the termination condition.

Overrides:
propagateOnAbort in class CadaverRecord
Returns:
true

typeIs

public int typeIs()
Description copied from class: CadaverRecord
The type of the record.

Overrides:
typeIs in class CadaverRecord
Returns:
RecordType.PERSISTENT
See Also:
RecordType

className

public ClassName className()
Description copied from class: CadaverRecord
The ClassName representation of this class.

Overrides:
className in class CadaverRecord
Returns:
ClassName to identify this abstract record.

nestedAbort

public int nestedAbort()
Description copied from class: CadaverRecord
The nested transaction has aborted. The record will invalidate any new state.

Overrides:
nestedAbort in class CadaverRecord
Returns:
TwoPhaseOutcome to indicate success/failure.
See Also:
TwoPhaseOutcome

nestedCommit

public int nestedCommit()
nestedCommit does nothing since the passing of the state up to the parent action is handled by the record list merging system. In fact since nestedPrepare returns PREPARE_READONLY this function should never actaully be called

Returns:
TwoPhaseOutcome to indicate success/failure.
See Also:
TwoPhaseOutcome

nestedPrepare

public int nestedPrepare()
Description copied from class: CadaverRecord
The nested transaction is preparing. If there is any new state for the object being removed, and that state is valid, then this record will call nestedPrepare on the object being removed. If we have no new state then we cannot commit and must force an abort. Do this by failing the prepare phase.

Overrides:
nestedPrepare in class CadaverRecord
Returns:
TwoPhaseOutcome to indicate success/failure.
See Also:
TwoPhaseOutcome

topLevelAbort

public int topLevelAbort()
Description copied from class: CadaverRecord
The nested transaction has aborted. Invalidate any new state.

Overrides:
topLevelAbort in class CadaverRecord
Returns:
TwoPhaseOutcome to indicate success/failure.
See Also:
TwoPhaseOutcome

topLevelCommit

public int topLevelCommit()
At topLevelCommit we remove the state from the object store.

Overrides:
topLevelCommit in class CadaverRecord
Returns:
TwoPhaseOutcome to indicate success/failure.
See Also:
TwoPhaseOutcome

topLevelPrepare

public int topLevelPrepare()
Description copied from class: CadaverRecord
At topLevelPrepare write uncommitted version into object store. Cannot use inherited version since that assumes object is alive instead talk directly to the object store itself.

Overrides:
topLevelPrepare in class CadaverRecord
Returns:
TwoPhaseOutcome to indicate success/failure.
See Also:
TwoPhaseOutcome

print

public void print(java.io.PrintWriter strm)
Description copied from class: CadaverRecord
Override AbstractRecord.print to write specific information to the specified stream.

Overrides:
print in class CadaverRecord

doSave

public boolean doSave()
Description copied from class: CadaverRecord
Override the AbstractRecord.doSave.

Overrides:
doSave in class CadaverRecord
Returns:
true if the object being removed is a persistent object (RecordType.PERSISTENT). false otherwise.
See Also:
RecordType

save_state

public boolean save_state(OutputObjectState os,
                          int ot)
Description copied from class: AbstractRecord
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). If the answer is yes, then save_state is called and the record instance must save enough information to enable it to be restored from that state later. The basic AbstractRecord save_state will save common data that is required by the base class during recovery.

Overrides:
save_state in class PersistenceRecord
Returns:
true if successful, false otherwise.

restore_state

public boolean restore_state(InputObjectState os,
                             int ot)
Description copied from class: AbstractRecord
During recovery, the transaction log is given to the recovery system and it will recreate a transaction instance to perform necessary recovery actions. This transaction will recreate the intentions list and give each recreated AbstractRecord the state that that was saved during transaction persistence. The base class will restore information that it needs from the log.

Overrides:
restore_state in class PersistenceRecord
Returns:
true if successful, false otherwise.

type

public java.lang.String type()
Description copied from class: CadaverRecord
The type of the class - may be used to save information in an hierarchical manner in the object store.

Overrides:
type in class CadaverRecord

shouldAdd

public boolean shouldAdd(AbstractRecord a)
Description copied from class: AbstractRecord
Should we add the record presented to the intentions list?

Returns:
true if the record should be added, false otherwise.

shouldMerge

public boolean shouldMerge(AbstractRecord a)
Description copied from class: CadaverRecord
Overrides AbstractRecord.shouldMerge

Overrides:
shouldMerge in class CadaverRecord
Returns:
true if this instance and the parameter have the same id (order()) and the parameter is either persistent or recoverable. false otherwise.
See Also:
RecordType

shouldReplace

public boolean shouldReplace(AbstractRecord a)
Description copied from class: CadaverRecord
Overrides AbstractRecord.shouldReplace

Overrides:
shouldReplace in class CadaverRecord
Returns:
true if this instance and the parameter have the same id (order()) and the parameter is either persistent or recoverable. false otherwise.
See Also:
RecordType

shouldAlter

public boolean shouldAlter(AbstractRecord a)
Description copied from class: AbstractRecord
Should we alter the current record with the one presented?

Returns:
true if the record should be altered, false otherwise.

create

public static AbstractRecord create()

value

public java.lang.Object value()
Description copied from class: AbstractRecord
If this abstract record caused a heuristic then it should return an object which implements HeuristicInformation

Specified by:
value in class AbstractRecord
Returns:
Object to be used to order.

setValue

public void setValue(java.lang.Object newState)
Specified by:
setValue in class AbstractRecord

alter

public void alter(AbstractRecord a)
Description copied from class: AbstractRecord
Alter the current record with the one presented.

Specified by:
alter in class AbstractRecord

forgetAction

protected final void forgetAction(boolean commit)