public class CoordinatorImp extends java.lang.Object implements CompositeCoordinator, Participant, RecoveryCoordinator, RecoverableCoordinator, AlarmTimerListener, Stateful, FSMPreEnterListener, FSMTransitionListener
READ_ONLY
Modifier | Constructor and Description |
---|---|
|
CoordinatorImp()
No argument constructor as required by Recoverable interface.
|
protected |
CoordinatorImp(java.lang.String root)
Constructor for testing only.
|
protected |
CoordinatorImp(java.lang.String recoveryDomainName,
java.lang.String coordinatorId,
java.lang.String root,
RecoveryCoordinator coord,
long timeout,
boolean single_threaded_2pc)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addFSMPreEnterListener(FSMPreEnterListener l,
TxState state) |
void |
alarm(AlarmTimer timer) |
void |
commit(boolean onePhase) |
protected void |
dispose() |
void |
forget() |
java.lang.String |
getCoordinatorId() |
Participant |
getParticipant() |
java.util.Vector<Participant> |
getParticipants() |
PendingTransactionRecord |
getPendingTransactionRecord(TxState state) |
RecoveryCoordinator |
getRecoveryCoordinator() |
java.lang.String |
getRecoveryDomainName() |
java.lang.String |
getResourceName() |
java.lang.String |
getRootId() |
TxState |
getState() |
TxState |
getStateWithTwoPhaseCommitDecision() |
protected long |
getTimeOut() |
java.lang.String |
getURI() |
boolean |
hasActiveSiblings() |
protected void |
incLocalSiblingsStarted()
Called when a tx import is being done.
|
protected void |
incLocalSiblingsTerminated() |
boolean |
isCommitted()
Tests if the transaction was committed or not.
|
boolean |
isRoot() |
void |
preEnter(FSMEnterEvent event)
Called BEFORE the FSM enters the new state, so that
the callee is sure that nobody has seen the new state yet.
|
int |
prepare() |
java.lang.Boolean |
replayCompletion(Participant participant) |
void |
rollback() |
void |
setCascadeList(java.util.Map<java.lang.String,java.lang.Integer> allParticipants) |
void |
setGlobalSiblingCount(int count) |
protected void |
terminate(boolean commit)
Terminate the work, on behalf of Terminator.
|
void |
timedout(boolean rollbackOnly) |
void |
transitionPerformed(FSMTransitionEvent e)
A method to be called AFTER the specified transition is done.
|
protected CoordinatorImp(java.lang.String root)
protected CoordinatorImp(java.lang.String recoveryDomainName, java.lang.String coordinatorId, java.lang.String root, RecoveryCoordinator coord, long timeout, boolean single_threaded_2pc)
recoveryDomainName
- coordinatorId
- root
- The root tid.coord
- The RecoverCoordinator, null if root.console
- The console to log to, or null if none.timeout
- The timeout in milliseconds for indoubts before a heuristic
decision is made.single_threaded_2pc
- If true then commit is done in the same thread as the one that
started the tx.public CoordinatorImp()
public java.util.Vector<Participant> getParticipants()
public boolean isCommitted()
protected long getTimeOut()
public TxState getState()
public void addFSMPreEnterListener(FSMPreEnterListener l, TxState state)
addFSMPreEnterListener
in interface FSMPreEnterEventSource
public RecoveryCoordinator getRecoveryCoordinator()
getRecoveryCoordinator
in interface CompositeCoordinator
CompositeCoordinator.
public Participant getParticipant() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
CompositeCoordinator.
public java.lang.String getCoordinatorId()
getCoordinatorId
in interface CompositeCoordinator
CompositeCoordinator
protected void incLocalSiblingsStarted()
protected void incLocalSiblingsTerminated() throws HeurRollbackException, HeurMixedException, SysException, java.lang.SecurityException, HeurCommitException, HeurHazardException, java.lang.IllegalStateException, RollbackException
HeurRollbackException
HeurMixedException
SysException
java.lang.SecurityException
HeurCommitException
HeurHazardException
java.lang.IllegalStateException
RollbackException
public boolean hasActiveSiblings()
public void preEnter(FSMEnterEvent event) throws java.lang.IllegalStateException
FSMPreEnterListener
preEnter
in interface FSMPreEnterListener
java.lang.IllegalStateException
- on failure.
The callee can use this to prevent the state change from
happening.FSMPreEnterListener.
public java.lang.String getURI()
getURI
in interface Participant
getURI
in interface RecoveryCoordinator
Participant
public void forget()
forget
in interface Participant
Participant.
public void setCascadeList(java.util.Map<java.lang.String,java.lang.Integer> allParticipants) throws SysException
setCascadeList
in interface Participant
SysException
Participant.
public void setGlobalSiblingCount(int count)
setGlobalSiblingCount
in interface Participant
Participant.
public int prepare() throws RollbackException, java.lang.IllegalStateException, HeurHazardException, HeurMixedException, SysException
prepare
in interface Participant
RollbackException
java.lang.IllegalStateException
HeurHazardException
HeurMixedException
SysException
Participant.
public void commit(boolean onePhase) throws HeurRollbackException, HeurMixedException, HeurHazardException, java.lang.IllegalStateException, RollbackException, SysException
commit
in interface Participant
HeurRollbackException
HeurMixedException
HeurHazardException
java.lang.IllegalStateException
RollbackException
SysException
Participant.
public void rollback() throws HeurCommitException, HeurMixedException, SysException, HeurHazardException, java.lang.IllegalStateException
rollback
in interface Participant
HeurCommitException
HeurMixedException
SysException
HeurHazardException
java.lang.IllegalStateException
Participant.
public java.lang.Boolean replayCompletion(Participant participant) throws java.lang.IllegalStateException
java.lang.IllegalStateException
RecoveryCoordinator.
public void alarm(AlarmTimer timer)
alarm
in interface AlarmTimerListener
protected void dispose()
protected void terminate(boolean commit) throws HeurRollbackException, HeurMixedException, SysException, java.lang.SecurityException, HeurCommitException, HeurHazardException, RollbackException, java.lang.IllegalStateException
commit
- True iff commit termination is asked.HeurRollbackException
HeurMixedException
SysException
java.lang.SecurityException
HeurCommitException
HeurHazardException
RollbackException
java.lang.IllegalStateException
public TxState getStateWithTwoPhaseCommitDecision()
public void transitionPerformed(FSMTransitionEvent e)
FSMTransitionListener
transitionPerformed
in interface FSMTransitionListener
e
- The transition that was made.public PendingTransactionRecord getPendingTransactionRecord(TxState state)
getPendingTransactionRecord
in interface RecoverableCoordinator
public java.lang.String getResourceName()
getResourceName
in interface Participant
public java.lang.String getRootId()
getRootId
in interface CompositeCoordinator
public void timedout(boolean rollbackOnly)
public boolean isRoot()
public java.lang.String getRecoveryDomainName()
getRecoveryDomainName
in interface RecoveryCoordinator
Copyright © 2020. All Rights Reserved.