Class DisposeRecord
java.lang.Object
com.arjuna.ats.arjuna.StateManager
com.arjuna.ats.arjuna.coordinator.AbstractRecord
com.arjuna.ats.internal.arjuna.abstractrecords.RecoveryRecord
com.arjuna.ats.internal.arjuna.abstractrecords.PersistenceRecord
com.arjuna.ats.internal.arjuna.abstractrecords.CadaverRecord
com.arjuna.ats.internal.arjuna.abstractrecords.DisposeRecord
-
Field Summary
Fields inherited from class com.arjuna.ats.internal.arjuna.abstractrecords.PersistenceRecord
classicPrepare, MAX_OBJECT_SIZE, shadowMade, targetParticipantStore, topLevelState
Fields inherited from class com.arjuna.ats.internal.arjuna.abstractrecords.RecoveryRecord
objectAddr, state
Fields inherited from class com.arjuna.ats.arjuna.StateManager
modifyingActions, objectModel, objectUid, synchronizationLock, usingActions
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
doSave()
Override the AbstractRecord.doSave.int
The nested transaction has aborted.int
nestedCommit does nothing since the passing of the state up to the parent action is handled by the record list merging system.int
The nested transaction is preparing.void
print
(PrintWriter strm) Override AbstractRecord.print to write specific information to the specified stream.boolean
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).boolean
Should we add the record presented to the intentions list?boolean
Should we alter the current record with the one presented?boolean
Overrides AbstractRecord.shouldMergeboolean
Overrides AbstractRecord.shouldReplaceint
The nested transaction has aborted.int
At topLevelCommit we remove the state from the object participantStore.int
At topLevelPrepare write uncommitted version into object participantStore.type()
The type of the class - may be used to save information in an hierarchical manner in the object participantStore.int
typeIs()
The type of the record.Methods inherited from class com.arjuna.ats.internal.arjuna.abstractrecords.CadaverRecord
merge
Methods inherited from class com.arjuna.ats.internal.arjuna.abstractrecords.PersistenceRecord
shadowForced, topLevelCleanup
Methods inherited from class com.arjuna.ats.internal.arjuna.abstractrecords.RecoveryRecord
alter, forgetAction, setValue, value
Methods inherited from class com.arjuna.ats.arjuna.coordinator.AbstractRecord
clearHeuristicDecision, create, equals, forgetHeuristic, getNext, getPrevious, getTypeOfObject, greaterThan, isPermittedTopLevelOnePhaseCommit, lessThan, nestedCleanup, nestedOnePhaseCommit, order, propagateOnCommit, replace, setNext, setPrevious, topLevelOnePhaseCommit
Methods inherited from class com.arjuna.ats.arjuna.StateManager
activate, activate, cleanup, createLists, deactivate, deactivate, deactivate, destroy, disable, forgetAction, get_uid, getCreationTimeMillis, getMutex, getObjectModel, getStore, getStoreRoot, loadObjectState, lockMutex, modified, objectType, packHeader, persist, rememberAction, setStatus, setupStore, setupStore, setupStore, status, terminate, tryLockMutex, unlockMutex, unpackHeader
-
Constructor Details
-
DisposeRecord
-
DisposeRecord
public DisposeRecord()
-
-
Method Details
-
propagateOnAbort
public boolean propagateOnAbort()Description copied from class:CadaverRecord
Override default AbstractRecord method. CadaverRecords are propagated regardless of the termination condition.- Overrides:
propagateOnAbort
in classCadaverRecord
- Returns:
true
-
typeIs
public int typeIs()Description copied from class:CadaverRecord
The type of the record.- Overrides:
typeIs
in classCadaverRecord
- Returns:
- RecordType.PERSISTENT
- See Also:
-
nestedAbort
public int nestedAbort()Description copied from class:CadaverRecord
The nested transaction has aborted. The record will invalidate any new state.- Overrides:
nestedAbort
in classCadaverRecord
- Returns:
TwoPhaseOutcome
to indicate success/failure.- See Also:
-
nestedCommit
public int nestedCommit()Description copied from class:RecoveryRecord
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 actually be called- Overrides:
nestedCommit
in classRecoveryRecord
- Returns:
TwoPhaseOutcome
to indicate success/failure.- See Also:
-
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 classCadaverRecord
- Returns:
TwoPhaseOutcome
to indicate success/failure.- See Also:
-
topLevelAbort
public int topLevelAbort()Description copied from class:CadaverRecord
The nested transaction has aborted. Invalidate any new state.- Overrides:
topLevelAbort
in classCadaverRecord
- Returns:
TwoPhaseOutcome
to indicate success/failure.- See Also:
-
topLevelCommit
public int topLevelCommit()At topLevelCommit we remove the state from the object participantStore.- Overrides:
topLevelCommit
in classCadaverRecord
- Returns:
TwoPhaseOutcome
to indicate success/failure.- See Also:
-
topLevelPrepare
public int topLevelPrepare()Description copied from class:CadaverRecord
At topLevelPrepare write uncommitted version into object participantStore. Cannot use inherited version since that assumes object is alive instead talk directly to the object participantStore itself.- Overrides:
topLevelPrepare
in classCadaverRecord
- Returns:
TwoPhaseOutcome
to indicate success/failure.- See Also:
-
print
Description copied from class:CadaverRecord
Override AbstractRecord.print to write specific information to the specified stream.- Overrides:
print
in classCadaverRecord
- Parameters:
strm
- the stream to use.
-
doSave
public boolean doSave()Description copied from class:CadaverRecord
Override the AbstractRecord.doSave.- Overrides:
doSave
in classCadaverRecord
- Returns:
true
if the object being removed is a persistent object (RecordType.PERSISTENT).false
otherwise.- See Also:
-
save_state
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. If a derived class calls super.save_state then it must be called before packing any other data item.- Overrides:
save_state
in classPersistenceRecord
- Returns:
true
if successful,false
otherwise.
-
restore_state
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. Data items must be unpacked in the same order that they were packed.- Overrides:
restore_state
in classPersistenceRecord
- Returns:
true
if successful,false
otherwise.
-
type
Description copied from class:CadaverRecord
The type of the class - may be used to save information in an hierarchical manner in the object participantStore.- Overrides:
type
in classCadaverRecord
-
shouldAdd
Description copied from class:AbstractRecord
Should we add the record presented to the intentions list?- Overrides:
shouldAdd
in classRecoveryRecord
- Parameters:
a
- The record to try to add.- Returns:
true
if the record should be added,false
otherwise.
-
shouldMerge
Description copied from class:CadaverRecord
Overrides AbstractRecord.shouldMerge- Overrides:
shouldMerge
in classCadaverRecord
- Parameters:
a
- the record to potentially merge with.- 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:
-
shouldReplace
Description copied from class:CadaverRecord
Overrides AbstractRecord.shouldReplace- Overrides:
shouldReplace
in classCadaverRecord
- Parameters:
a
- the record to potentially replace this instance.- 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:
-
shouldAlter
Description copied from class:AbstractRecord
Should we alter the current record with the one presented?- Overrides:
shouldAlter
in classRecoveryRecord
- Parameters:
a
- The record to try to alter.- Returns:
true
if the record should be altered,false
otherwise.
-