|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atomikos.icatch.imp.CoordinatorImp
public class CoordinatorImp
All things related to termination logic.
| Field Summary |
|---|
| Fields inherited from interface com.atomikos.icatch.Participant |
|---|
READ_ONLY |
| Constructor Summary | |
|---|---|
|
CoordinatorImp()
No argument constructor as required by Recoverable interface. |
protected |
CoordinatorImp(String root,
boolean heuristic_commit,
boolean checkorphans)
Constructor for testing only. |
|
CoordinatorImp(String root,
RecoveryCoordinator coord,
boolean heuristic_commit,
boolean checkorphans)
Constructor. |
protected |
CoordinatorImp(String root,
RecoveryCoordinator coord,
boolean heuristic_commit,
long timeout,
boolean checkorphans,
boolean single_threaded_2pc)
Constructor. |
| Method Summary | |
|---|---|
void |
addFSMEnterListener(FSMEnterListener l,
TxState state)
|
void |
addFSMPreEnterListener(FSMPreEnterListener l,
TxState state)
|
RecoveryCoordinator |
addParticipant(Participant participant)
|
void |
alarm(AlarmTimer timer)
|
HeuristicMessage[] |
commit(boolean onePhase)
|
HeuristicMessage[] |
commitHeuristically()
|
protected void |
dispose()
|
void |
entered(FSMEnterEvent<TxState> e)
|
void |
forget()
|
String |
getCoordinatorId()
|
TxState[] |
getFinalStates()
Needed by the Recovery system to determine when a logged state can be forgotten. |
HeuristicMessage[] |
getHeuristicMessages()
Get the heuristic info for the message round. |
HeuristicMessage[] |
getHeuristicMessages(Object heuristicState)
Gets the heuristic messages for all participants that are in the given heuristic state |
Object |
getId()
|
ObjectImage |
getObjectImage()
Get an object image for this instance. |
ObjectImage |
getObjectImage(TxState state)
Get an object image for the given state. |
Participant |
getParticipant()
|
TxState[] |
getRecoverableStates()
Get the states that should be recoverable. |
RecoveryCoordinator |
getRecoveryCoordinator()
|
TxState |
getState()
|
TxState |
getStateWithTwoPhaseCommitDecision()
|
HeuristicMessage[] |
getTags()
Get the heuristic tags for this coordinator. |
protected long |
getTimeOut()
|
String |
getURI()
|
protected void |
incLocalSiblingCount()
Called when a tx import is being done. |
boolean |
isCommitted()
Tests if the transaction was committed or not. |
Boolean |
isRecoverableWhileActive()
|
void |
preEnter(FSMEnterEvent<TxState> event)
|
int |
prepare()
|
boolean |
recover()
|
Boolean |
replayCompletion(Participant participant)
|
protected void |
restore(ObjectImage image)
Help function for restoration. |
HeuristicMessage[] |
rollback()
|
HeuristicMessage[] |
rollbackHeuristically()
|
void |
setCascadeList(Dictionary allParticipants)
|
void |
setGlobalSiblingCount(int count)
|
void |
setRecoverableWhileActive()
|
protected void |
startThreads(long timeout)
Start threads, propagator and timer logic. |
protected void |
terminate(boolean commit)
Terminate the work, on behalf of Terminator. |
void |
transitionPerformed(FSMTransitionEvent<TxState> e)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected CoordinatorImp(String root,
boolean heuristic_commit,
boolean checkorphans)
protected CoordinatorImp(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(String root,
RecoveryCoordinator coord,
boolean heuristic_commit,
boolean checkorphans)
root - The root String for this one.console - The console to log to, or null if none.coord - The recovery coordinator for indoubt resolution.heuristic_commit - If true, heuristic decision is commit.checkorphans - If true, orphan checking is done at prepare.public CoordinatorImp()
| Method Detail |
|---|
public Boolean isRecoverableWhileActive()
isRecoverableWhileActive in interface CompositeCoordinatorpublic HeuristicMessage[] getHeuristicMessages(Object heuristicState)
heuristicState - The heuristic state, or the terminated state.
public boolean isCommitted()
public HeuristicMessage[] getHeuristicMessages()
getHeuristicMessages in interface Participantpublic HeuristicMessage[] getTags()
getTags in interface CompositeCoordinatorprotected void startThreads(long timeout)
timeout - The timeout for the thread wakeup interval.console - The console, null if none.protected long getTimeOut()
public TxState getState()
getState in interface Stateful<TxState>Stateful
public void addFSMEnterListener(FSMEnterListener l,
TxState state)
FSMEnterEventSource.
public void addFSMPreEnterListener(FSMPreEnterListener l,
TxState state)
addFSMPreEnterListener in interface FSMPreEnterEventSource<TxState>public RecoveryCoordinator getRecoveryCoordinator()
getRecoveryCoordinator in interface CompositeCoordinatorCompositeCoordinator.
public Participant getParticipant()
throws UnsupportedOperationException
UnsupportedOperationExceptionCompositeCoordinator.public String getCoordinatorId()
getCoordinatorId in interface CompositeCoordinatorCompositeCoordinator
public RecoveryCoordinator addParticipant(Participant participant)
throws SysException,
IllegalStateException,
RollbackException
SysException
IllegalStateException
RollbackExceptionprotected void incLocalSiblingCount()
public void preEnter(FSMEnterEvent<TxState> event)
throws IllegalStateException
preEnter in interface FSMPreEnterListener<TxState>IllegalStateExceptionFSMPreEnterListener.public String getURI()
getURI in interface ParticipantgetURI in interface RecoveryCoordinatorParticipant
public boolean recover()
throws SysException
recover in interface ParticipantSysExceptionParticipantpublic void forget()
forget in interface ParticipantParticipant.
public void setCascadeList(Dictionary 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 ParticipantRollbackException
IllegalStateException
HeurHazardException
HeurMixedException
SysExceptionParticipant.
public HeuristicMessage[] commit(boolean onePhase)
throws HeurRollbackException,
HeurMixedException,
HeurHazardException,
IllegalStateException,
RollbackException,
SysException
commit in interface ParticipantHeurRollbackException
HeurMixedException
HeurHazardException
IllegalStateException
RollbackException
SysExceptionParticipant.
public HeuristicMessage[] rollback()
throws HeurCommitException,
HeurMixedException,
SysException,
HeurHazardException,
IllegalStateException
rollback in interface ParticipantHeurCommitException
HeurMixedException
SysException
HeurHazardException
IllegalStateExceptionParticipant.
public HeuristicMessage[] rollbackHeuristically()
throws HeurCommitException,
HeurMixedException,
SysException,
HeurHazardException,
IllegalStateException
HeurCommitException
HeurMixedException
SysException
HeurHazardException
IllegalStateException
public HeuristicMessage[] commitHeuristically()
throws HeurMixedException,
SysException,
HeurRollbackException,
HeurHazardException,
IllegalStateException,
RollbackException
HeurMixedException
SysException
HeurRollbackException
HeurHazardException
IllegalStateException
RollbackException
public Boolean replayCompletion(Participant participant)
throws IllegalStateException
replayCompletion in interface RecoveryCoordinatorIllegalStateExceptionRecoveryCoordinator.protected void restore(ObjectImage image)
public ObjectImage getObjectImage()
Recoverable
getObjectImage in interface RecoverableRecoverablepublic ObjectImage getObjectImage(TxState state)
StateRecoverable
getObjectImage in interface StateRecoverable<TxState>state - The state about to be reached. Because the instance is not yet
IN the new state, this state is supplied as a parameter.
StateRecoverablepublic TxState[] getRecoverableStates()
StateRecoverable
getRecoverableStates in interface StateRecoverable<TxState>StateRecoverablepublic TxState[] getFinalStates()
StateRecoverable
getFinalStates in interface StateRecoverable<TxState>StateRecoverablepublic Object getId()
getId in interface IdentifiableRecoverablepublic 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.
HeurRollbackException
HeurMixedException
SysException
SecurityException
HeurCommitException
HeurHazardException
RollbackException
IllegalStateException
public void setRecoverableWhileActive()
throws UnsupportedOperationException
setRecoverableWhileActive in interface CompositeCoordinatorUnsupportedOperationExceptionpublic TxState getStateWithTwoPhaseCommitDecision()
public void transitionPerformed(FSMTransitionEvent<TxState> e)
transitionPerformed in interface FSMTransitionListener<TxState>public void entered(FSMEnterEvent<TxState> e)
entered in interface FSMEnterListener<TxState>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||