public class CoordinatorImp extends java.lang.Object implements CompositeCoordinator, Participant, RecoveryCoordinator, RecoverableCoordinator, AlarmTimerListener, Stateful, FSMPreEnterListener, FSMTransitionListener, FSMEnterListener
READ_ONLY| Modifier | Constructor and Description |
|---|---|
|
CoordinatorImp()
No argument constructor as required by Recoverable interface.
|
protected |
CoordinatorImp(java.lang.String root,
boolean heuristic_commit,
boolean checkorphans)
Constructor for testing only.
|
protected |
CoordinatorImp(java.lang.String root,
RecoveryCoordinator coord,
boolean heuristic_commit,
long timeout,
boolean checkorphans,
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 |
entered(FSMEnterEvent e)
Called when the FSM has entered a new state.
|
void |
forget() |
java.lang.String |
getCoordinatorId() |
CoordinatorLogEntry |
getCoordinatorLogEntry() |
CoordinatorLogEntry |
getCoordinatorLogEntry(TxState state) |
java.lang.Object |
getId() |
Participant |
getParticipant() |
java.util.Collection<ParticipantLogEntry> |
getParticipantLogEntries() |
java.util.Vector<Participant> |
getParticipants() |
RecoveryCoordinator |
getRecoveryCoordinator() |
java.lang.String |
getResourceName() |
TxState |
getState() |
TxState |
getStateWithTwoPhaseCommitDecision() |
protected long |
getTimeOut() |
java.lang.String |
getURI() |
protected void |
incLocalSiblingCount()
Called when a tx import is being done.
|
boolean |
isCommitted()
Tests if the transaction was committed or not.
|
boolean |
isRecoverable() |
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 |
transitionPerformed(FSMTransitionEvent e)
A method to be called AFTER the specified transition is done.
|
protected CoordinatorImp(java.lang.String root,
boolean heuristic_commit,
boolean checkorphans)
protected CoordinatorImp(java.lang.String root,
RecoveryCoordinator coord,
boolean heuristic_commit,
long timeout,
boolean checkorphans,
boolean single_threaded_2pc)
root - The root tid.coord - The RecoverCoordinator, null if root.console - The console to log to, or null if none.heuristic_commit - Whether to do commit on heuristic.timeout - The timeout in milliseconds for indoubts before a heuristic
decision is made.checkorphans - If true, orphan checks are made on prepare. For OTS, this is
false.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 FSMPreEnterEventSourcepublic RecoveryCoordinator getRecoveryCoordinator()
getRecoveryCoordinator in interface CompositeCoordinatorCompositeCoordinator.public Participant getParticipant() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationExceptionCompositeCoordinator.public java.lang.String getCoordinatorId()
getCoordinatorId in interface CompositeCoordinatorCompositeCoordinatorprotected void incLocalSiblingCount()
public void preEnter(FSMEnterEvent event) throws java.lang.IllegalStateException
FSMPreEnterListenerpreEnter in interface FSMPreEnterListenerjava.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 ParticipantgetURI in interface RecoveryCoordinatorParticipantpublic void forget()
forget in interface ParticipantParticipant.public void setCascadeList(java.util.Map<java.lang.String,java.lang.Integer> allParticipants)
throws SysException
setCascadeList in interface ParticipantSysExceptionParticipant.public void setGlobalSiblingCount(int count)
setGlobalSiblingCount in interface ParticipantParticipant.public int prepare()
throws RollbackException,
java.lang.IllegalStateException,
HeurHazardException,
HeurMixedException,
SysException
prepare in interface ParticipantRollbackExceptionjava.lang.IllegalStateExceptionHeurHazardExceptionHeurMixedExceptionSysExceptionParticipant.public void commit(boolean onePhase)
throws HeurRollbackException,
HeurMixedException,
HeurHazardException,
java.lang.IllegalStateException,
RollbackException,
SysException
commit in interface ParticipantHeurRollbackExceptionHeurMixedExceptionHeurHazardExceptionjava.lang.IllegalStateExceptionRollbackExceptionSysExceptionParticipant.public void rollback()
throws HeurCommitException,
HeurMixedException,
SysException,
HeurHazardException,
java.lang.IllegalStateException
rollback in interface ParticipantHeurCommitExceptionHeurMixedExceptionSysExceptionHeurHazardExceptionjava.lang.IllegalStateExceptionParticipant.public java.lang.Boolean replayCompletion(Participant participant) throws java.lang.IllegalStateException
replayCompletion in interface RecoveryCoordinatorjava.lang.IllegalStateExceptionRecoveryCoordinator.public java.lang.Object getId()
public void alarm(AlarmTimer timer)
alarm in interface AlarmTimerListenerprotected 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.HeurRollbackExceptionHeurMixedExceptionSysExceptionjava.lang.SecurityExceptionHeurCommitExceptionHeurHazardExceptionRollbackExceptionjava.lang.IllegalStateExceptionpublic TxState getStateWithTwoPhaseCommitDecision()
public void transitionPerformed(FSMTransitionEvent e)
FSMTransitionListenertransitionPerformed in interface FSMTransitionListenere - The transition that was made.public void entered(FSMEnterEvent e)
FSMEnterListenerentered in interface FSMEnterListenerpublic CoordinatorLogEntry getCoordinatorLogEntry(TxState state)
getCoordinatorLogEntry in interface RecoverableCoordinatorpublic CoordinatorLogEntry getCoordinatorLogEntry()
public java.util.Collection<ParticipantLogEntry> getParticipantLogEntries()
public boolean isRecoverable()
isRecoverable in interface Participantpublic java.lang.String getResourceName()
getResourceName in interface ParticipantCopyright © 2017. All Rights Reserved.