public class SubordinateATCoordinator extends ATCoordinator
Modifier and Type | Class and Description |
---|---|
static class |
SubordinateATCoordinator.SubordinateCallback
class implemented by any code which wishes to register a callabck
|
Modifier and Type | Field and Description |
---|---|
static String |
PARTICIPANT_PREFIX
unique string used as prefix for participant ids to ensure they can be identified at recovery
|
static String |
SUBORDINATE_TX_TYPE_AT_AT
standard AT subordinate tx type for an AT subordinate created below another AT transaction
|
static String |
TRANSACTION_TYPE
type string used to locate TX log records in the tx object store hierarchy
|
failedList, heuristicList, pendingList, preparedList, readonlyList, savedIntentionList
modifyingActions, objectModel, objectUid, usingActions
Constructor and Description |
---|
SubordinateATCoordinator()
normal constructor
|
SubordinateATCoordinator(String subordinateType)
bridge wrapper constructor
|
SubordinateATCoordinator(Uid recovery)
constructor for recovered coordinator
|
Modifier and Type | Method and Description |
---|---|
static void |
addActiveProxy(String id) |
static void |
addCallback(String key,
SubordinateATCoordinator.SubordinateCallback callback)
register a callback to be called when a subordinate transaction with a specific key executes
a commit or rollback.
|
protected static void |
addRecoveredCoordinator(SubordinateATCoordinator coordinator) |
int |
cancel()
If this method is called and a transaction is not in a status of RUNNING,
ABORT_ONLY or COMMITTING then do not call afterCompletion.
|
void |
commit()
this is driven by a durable participant registered on behalf of the coordinator and does a
normal commit minus the after completion processing which will be driven by a volatile
participant also registerd for this coordinator..
|
void |
commitVolatile()
this is driven by a volatile participant registered on behalf of the coordinator
|
Outcome |
coordinate(CompletionStatus cs)
If the application requires and if the coordination protocol supports it,
then this method can be used to execute a coordination protocol on the
currently enlisted participants at any time prior to the termination of
the coordination scope.
|
int |
end(boolean reportHeuristics) |
void |
error()
called by the durable participant during recovery processing
TODO clarify when and why this gets called and what to do about it
|
String |
getDurable2PhaseId()
return a uid for the durable participant registered on behalf of this corodinator
|
static SubordinateATCoordinator |
getRecoveredCoordinator(String coordinatorId) |
String |
getSubordinateType() |
String |
getVolatile2PhaseId()
return a uid for the volatile participant registered on behalf of this corodinator
|
boolean |
isActivated() |
boolean |
isOrphaned()
test whether a transaction has been restored without its proxy participant.
|
static SubordinateATCoordinator[] |
listRecoveredCoordinators() |
int |
prepare()
this is driven by a durable participant registered on behalf of the coordinator and does a
normal prepare mninus the before completion processing which has already been performed
|
boolean |
prepareVolatile()
this is driven by a volatile participant registered on behalf of the coordinator
|
static void |
removeActiveProxy(String id) |
protected static void |
removeRecoveredCoordinator(SubordinateATCoordinator coordinator) |
boolean |
restore_state(InputObjectState os,
int ot)
This assumes the various lists are zero length when it is called.
|
void |
rollback()
this is driven by a durable participant registered on behalf of the coordinator and does a
normal commit minus the after completion processing which will be driven by a volatile
participant also registerd for this coordinator..
|
void |
rollbackVolatile()
this is driven by a volatile participant registered on behalf of the coordinator
|
boolean |
save_state(OutputObjectState os,
int ot)
Redefined version of save_state and restore_state from StateManager.
|
protected void |
setActivated() |
String |
type()
Overloads BasicAction.type()
|
void |
unknown()
called by the durable participant during recovery processing
TODO clarify when and why this gets called and what to do about it
|
delistParticipant, delistSynchronization, enlistParticipant, enlistSynchronization, identifier, participantReadOnly, participantRolledBack, qualifiers
addSynchronization, afterCompletion, afterCompletion, asyncAfterCompletion, beforeCompletion, getDeferredThrowable, getSynchronizations, running, start, start
Abort, Abort, abortStatus, activate, activate, activeThreads, add, addChildAction, addChildThread, addChildThread, addRecord, async_prepare, Begin, checkForCurrent, childTransactions, commitStatus, 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, parent, phase2Abort, phase2Cleanup, phase2Commit, prepare, preparedStatus, preventCommit, removeChildAction, removeChildThread, removeChildThread, setCheckedAction, setHeuristicDecision, status, topLevelAction, topLevelActionUid, toString, typeOfAction, updateHeuristic, updateState
cleanup, createLists, deactivate, deactivate, disable, forgetAction, get_uid, getMutex, getObjectModel, getStoreRoot, loadObjectState, lockMutex, modified, objectType, packHeader, persist, print, rememberAction, setStatus, setupStore, setupStore, setupStore, terminate, tryLockMutex, unlockMutex, unpackHeader
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
get_uid, preventCommit
public static final String TRANSACTION_TYPE
public static String PARTICIPANT_PREFIX
public static final String SUBORDINATE_TX_TYPE_AT_AT
public SubordinateATCoordinator()
public SubordinateATCoordinator(String subordinateType)
public SubordinateATCoordinator(Uid recovery)
recovery
- public Outcome coordinate(CompletionStatus cs) throws WrongStateException, ProtocolViolationException, SystemException
coordinate
in class ATCoordinator
cs
- The completion status to use when determining how to
execute the protocol.WrongStateException
- Thrown if the coordinator is in a state the does not allow
coordination to occur.ProtocolViolationException
- Thrown if the protocol is violated in some manner during
execution.SystemException
- Thrown if any other error occurs.public int end(boolean reportHeuristics)
end
in class TwoPhaseCoordinator
public int cancel()
TwoPhaseCoordinator
cancel
in interface Reapable
cancel
in class TwoPhaseCoordinator
public boolean prepareVolatile()
public int prepare()
public void commitVolatile()
public void commit()
public void rollbackVolatile()
public void rollback()
public void unknown()
public void error()
public String type()
TwoPhaseCoordinator
type
in class ATCoordinator
public String getVolatile2PhaseId()
public String getDurable2PhaseId()
protected static void addRecoveredCoordinator(SubordinateATCoordinator coordinator)
protected static void removeRecoveredCoordinator(SubordinateATCoordinator coordinator)
public static void addActiveProxy(String id)
public static void removeActiveProxy(String id)
protected void setActivated()
public boolean isActivated()
public boolean isOrphaned()
public static SubordinateATCoordinator getRecoveredCoordinator(String coordinatorId)
public static SubordinateATCoordinator[] listRecoveredCoordinators()
public String getSubordinateType()
public boolean save_state(OutputObjectState os, int ot)
BasicAction
save_state
in class BasicAction
true
if successful, false
otherwise.public boolean restore_state(InputObjectState os, int ot)
BasicAction
restore_state
in class BasicAction
true
if successful, false
otherwise.public static void addCallback(String key, SubordinateATCoordinator.SubordinateCallback callback)
key
- callback
- Copyright © 2021 JBoss by Red Hat. All rights reserved.