Class SubordinateAtomicAction
java.lang.Object
com.arjuna.ats.arjuna.StateManager
com.arjuna.ats.arjuna.coordinator.BasicAction
com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator
com.arjuna.ats.arjuna.AtomicAction
com.arjuna.ats.internal.jta.transaction.arjunacore.AtomicAction
com.arjuna.ats.internal.jta.transaction.arjunacore.subordinate.SubordinateAtomicAction
com.arjuna.ats.internal.jta.transaction.arjunacore.subordinate.jca.SubordinateAtomicAction
- All Implemented Interfaces:
Reapable
A subordinate JTA transaction; used when importing another transaction
context via JCA. This overrides the basic subordinate transaction simply so
that we can ensure JCA transactions are laid out in the right place in the
object store.
- Author:
- mcl
-
Field Summary
Fields inherited from class com.arjuna.ats.arjuna.AtomicAction
_timeout, NO_TIMEOUT
Fields inherited from class com.arjuna.ats.arjuna.coordinator.BasicAction
failedList, heuristicList, pendingList, preparedList, readonlyList, savedIntentionList, subordinate, threadStackTraceHistoryList
Fields inherited from class com.arjuna.ats.arjuna.StateManager
modifyingActions, objectModel, objectUid, synchronizationLock, usingActions
-
Constructor Summary
ConstructorDescriptionDeprecated.This is only used by test codeSubordinateAtomicAction
(int timeout, Xid xid) SubordinateAtomicAction
(Uid actId) SubordinateAtomicAction
(Uid actId, boolean peekXidOnly) Recovery SAA. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static final String
getType()
final Xid
getXid()
If the record was removed Xid will be nullboolean
restore_state
(InputObjectState os, int t) This assumes the various lists are zero length when it is called.boolean
save_state
(OutputObjectState os, int t) Redefined version of save_state and restore_state from StateManager.type()
The type of the class is used to locate the state of the transaction log in the object store.Methods inherited from class com.arjuna.ats.internal.jta.transaction.arjunacore.subordinate.SubordinateAtomicAction
abort, checkForCurrent, commit, commit, doBeforeCompletion, doCommit, doForget, doOnePhaseCommit, doPrepare, doRollback
Methods inherited from class com.arjuna.ats.arjuna.AtomicAction
addThread, addThread, begin, begin, cancel, end, getTimeout, removeThread, removeThread, resume, suspend
Methods inherited from class com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator
addSynchronization, afterCompletion, afterCompletion, asyncAfterCompletion, beforeCompletion, getDeferredThrowable, getSynchronizations, outputCapturedStackTraces, recordStackTraces, running, start, start
Methods inherited from class com.arjuna.ats.arjuna.coordinator.BasicAction
Abort, Abort, abortStatus, activate, activate, activeThreads, add, addChildAction, addChildThread, addChildThread, addRecord, async_prepare, Begin, childTransactions, commitStatus, createStackTraces, criticalEnd, criticalStart, Current, deactivate, destroy, doAbort, doAbort, doCommit, doCommit, doPrepare, End, equals, finalizeInternal, forgetHeuristics, getDeferredThrowables, getHeuristicDecision, getHierarchy, getSavingUid, getStore, hashCode, hierarchyDepth, insertRecord, isAncestor, maintainHeuristics, onePhaseCommit, onePhaseCommit, parent, phase2Abort, phase2Cleanup, phase2Commit, prepare, preparedStatus, preventCommit, removeChildAction, removeChildThread, removeChildThread, setCheckedAction, setHeuristicDecision, status, topLevelAction, topLevelActionUid, toString, typeOfAction, updateHeuristic, updateState
Methods inherited from class com.arjuna.ats.arjuna.StateManager
cleanup, createLists, deactivate, deactivate, disable, forgetAction, get_uid, getCreationTimeMillis, getMutex, getObjectModel, getStoreRoot, loadObjectState, lockMutex, modified, objectType, packHeader, persist, print, rememberAction, setStatus, setupStore, setupStore, setupStore, terminate, tryLockMutex, unlockMutex, unpackHeader
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.arjuna.ats.arjuna.coordinator.Reapable
get_uid, preventCommit
-
Constructor Details
-
SubordinateAtomicAction
public SubordinateAtomicAction()Deprecated.This is only used by test code -
SubordinateAtomicAction
-
SubordinateAtomicAction
public SubordinateAtomicAction(Uid actId, boolean peekXidOnly) throws ObjectStoreException, IOException Recovery SAA. If the record is removed and peekXidOnly is true then the Xid will be null.- Parameters:
actId
-peekXidOnly
-- Throws:
ObjectStoreException
IOException
-
SubordinateAtomicAction
-
-
Method Details
-
type
The type of the class is used to locate the state of the transaction log in the object store. Overloads BasicAction.type()- Overrides:
type
in classSubordinateAtomicAction
- Returns:
- a string representation of the hierarchy of the class for storing logs in the transaction object store.
-
getType
-
getXid
If the record was removed Xid will be null- Returns:
-
getParentNodeName
-
save_state
Description copied from class:BasicAction
Redefined version of save_state and restore_state from StateManager. Normal operation (no crashes): BasicAction.save_state is called after a successful prepare. This causes and BasicAction object to be saved in the object store. This object contains primarily the "intentions list" of the BasicAction. After successfully completing phase 2 of the commit protocol, the BasicAction object is deleted from the store. Failure cases: If a server crashes after successfully preparing, then upon recovery the action must be resolved (either committed or aborted) depending upon whether the co-ordinating atomic action committed or aborted. Upon server recovery, the crash recovery mechanism detects ServerBasicAction objects in the object store and attempts to activate the BasicAction object of the co-ordinating action. If this is successful then the SAA is committed else aborted. If, when processing phase 2 of the commit protocol, the co-ordinator experiences a failure to commit from one of the records then the BasicAction object is NOT deleted. It is rewritten when a new state which contains a list of the records that failed during phase 2 commit. This list is called the "failedList". The crash recovery manager will detect local BasicAction objects in addition to SAA objects in the objectstore. An attempt will be made to commit these actions. If the action contained a call to a now dead server, this action can never be resolved and the AA object can never be removed. However, if the action is purely local then after the processing is complete the removed by crash recovery.- Overrides:
save_state
in classBasicAction
- Returns:
true
if successful,false
otherwise.
-
restore_state
Description copied from class:BasicAction
This assumes the various lists are zero length when it is called.- Overrides:
restore_state
in classBasicAction
- Returns:
true
if successful,false
otherwise.
-
activated
public boolean activated()- Overrides:
activated
in classSubordinateAtomicAction
-