public class CoordinatorImp extends Object implements CompositeCoordinator, Participant, RecoveryCoordinator, RecoverableCoordinator, AlarmTimerListener, Stateful, FSMEnterListener, FSMTransitionListener
READ_ONLY| Modifier | Constructor and Description |
|---|---|
|
CoordinatorImp()
No argument constructor as required by Recoverable interface.
|
protected |
CoordinatorImp(String root)
Constructor for testing only.
|
protected |
CoordinatorImp(String recoveryDomainName,
String coordinatorId,
String root,
RecoveryCoordinator coord,
long timeout,
boolean single_threaded_2pc)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFSMEnterListener(FSMEnterListener l,
TxState state)
Add an enter event listener.
|
void |
alarm(AlarmTimer timer) |
void |
beforeTransition(FSMTransitionEvent e)
A method to be called BEFORE the specified transition takes place.
|
void |
commit(boolean onePhase) |
protected void |
dispose() |
void |
entered(FSMEnterEvent e)
Called when the FSM has entered a new state.
|
void |
forget() |
String |
getCoordinatorId() |
Participant |
getParticipant() |
Vector<Participant> |
getParticipants() |
PendingTransactionRecord |
getPendingTransactionRecord(TxState state) |
RecoveryCoordinator |
getRecoveryCoordinator() |
String |
getRecoveryDomainName() |
String |
getResourceName() |
String |
getRootId() |
TxState |
getState() |
TxState |
getStateWithTwoPhaseCommitDecision() |
protected long |
getTimeOut() |
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() |
Boolean |
replayCompletion(Participant participant) |
void |
rollback() |
void |
setCascadeList(Map<String,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(String root)
protected CoordinatorImp(String recoveryDomainName, String coordinatorId, 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 Vector<Participant> getParticipants()
public boolean isCommitted()
protected long getTimeOut()
public TxState getState()
public void addFSMEnterListener(FSMEnterListener l, TxState state)
FSMEnterEventSourceaddFSMEnterListener in interface FSMEnterEventSourcel - The listener.state - The state to listen on.FSMEnterEventSource.public RecoveryCoordinator getRecoveryCoordinator()
getRecoveryCoordinator in interface CompositeCoordinatorCompositeCoordinator.public Participant getParticipant() throws UnsupportedOperationException
UnsupportedOperationExceptionCompositeCoordinator.public String getCoordinatorId()
getCoordinatorId in interface CompositeCoordinatorCompositeCoordinatorprotected void incLocalSiblingsStarted()
protected void incLocalSiblingsTerminated()
throws HeurRollbackException,
HeurMixedException,
SysException,
SecurityException,
HeurCommitException,
HeurHazardException,
IllegalStateException,
RollbackException
public boolean hasActiveSiblings()
public void preEnter(FSMEnterEvent event) throws IllegalStateException
FSMEnterListenerpreEnter in interface FSMEnterListenerIllegalStateException - on failure.
The callee can use this to prevent the state change from
happening.FSMEnterListener.public String getURI()
getURI in interface ParticipantgetURI in interface RecoveryCoordinatorParticipantpublic void forget()
forget in interface ParticipantParticipant.public void setCascadeList(Map<String,Integer> allParticipants) throws SysException
setCascadeList in interface ParticipantSysExceptionParticipant.public void setGlobalSiblingCount(int count)
setGlobalSiblingCount in interface ParticipantParticipant.public int prepare()
throws RollbackException,
IllegalStateException,
HeurHazardException,
HeurMixedException,
SysException
prepare in interface ParticipantRollbackExceptionIllegalStateExceptionHeurHazardExceptionHeurMixedExceptionSysExceptionParticipant.public void commit(boolean onePhase)
throws HeurRollbackException,
HeurMixedException,
HeurHazardException,
IllegalStateException,
RollbackException,
SysException
commit in interface ParticipantHeurRollbackExceptionHeurMixedExceptionHeurHazardExceptionIllegalStateExceptionRollbackExceptionSysExceptionParticipant.public void rollback()
throws HeurCommitException,
HeurMixedException,
SysException,
HeurHazardException,
IllegalStateException
rollback in interface ParticipantHeurCommitExceptionHeurMixedExceptionSysExceptionHeurHazardExceptionIllegalStateExceptionParticipant.public Boolean replayCompletion(Participant participant) throws IllegalStateException
IllegalStateExceptionRecoveryCoordinator.public void alarm(AlarmTimer timer)
alarm in interface AlarmTimerListenerprotected void dispose()
protected void terminate(boolean commit)
throws HeurRollbackException,
HeurMixedException,
SysException,
SecurityException,
HeurCommitException,
HeurHazardException,
RollbackException,
IllegalStateException
commit - True iff commit termination is asked.HeurRollbackExceptionHeurMixedExceptionSysExceptionSecurityExceptionHeurCommitExceptionHeurHazardExceptionRollbackExceptionIllegalStateExceptionpublic TxState getStateWithTwoPhaseCommitDecision()
public void transitionPerformed(FSMTransitionEvent e)
FSMTransitionListenertransitionPerformed in interface FSMTransitionListenere - The transition that was made.public PendingTransactionRecord getPendingTransactionRecord(TxState state)
getPendingTransactionRecord in interface RecoverableCoordinatorpublic String getResourceName()
getResourceName in interface Participantpublic String getRootId()
getRootId in interface CompositeCoordinatorpublic void timedout(boolean rollbackOnly)
public boolean isRoot()
public String getRecoveryDomainName()
getRecoveryDomainName in interface RecoveryCoordinatorpublic void beforeTransition(FSMTransitionEvent e) throws IllegalStateException
FSMTransitionListenerbeforeTransition in interface FSMTransitionListenere - The transition that will be attempted.IllegalStateException - on failure.public void entered(FSMEnterEvent e)
FSMEnterListenerentered in interface FSMEnterListenerCopyright © 2023. All rights reserved.