com.arjuna.ats.arjuna.coordinator
Class TwoPhaseCoordinator

java.lang.Object
  extended bycom.arjuna.ats.arjuna.StateManager
      extended bycom.arjuna.ats.arjuna.coordinator.BasicAction
          extended bycom.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator
All Implemented Interfaces:
Reapable
Direct Known Subclasses:
AtomicAction

public class TwoPhaseCoordinator
extends BasicAction
implements Reapable

Adds support for synchronizations to BasicAction. It does not change thread associations either. It also allows any thread to terminate a transaction, even if it is not the transaction that is marked as current for the thread (unlike the BasicAction default).

Since:
JTS 3.0.
Version:
$Id: TwoPhaseCoordinator.java 2342 2006-03-30 13:06:17Z $
Author:
Mark Little (mark@arjuna.com)

Field Summary
 
Fields inherited from class com.arjuna.ats.arjuna.coordinator.BasicAction
failedList, heuristicList, pendingList, preparedList, readonlyList, savedIntentionList
 
Fields inherited from class com.arjuna.ats.arjuna.StateManager
modifyingActions, objectName, objectUid, smAttributes, usingActions
 
Constructor Summary
  TwoPhaseCoordinator()
           
protected TwoPhaseCoordinator(int at)
           
  TwoPhaseCoordinator(Uid id)
           
protected TwoPhaseCoordinator(Uid u, int at)
           
 
Method Summary
 int addSynchronization(SynchronizationRecord sr)
           
protected  boolean afterCompletion(int myStatus)
           
protected  boolean beforeCompletion()
           
 int cancel()
           
 int end(boolean report_heuristics)
           
 boolean running()
           
 int start()
           
 int start(BasicAction parentAction)
           
 java.lang.String type()
          Overloads BasicAction.type()
 
Methods inherited from class com.arjuna.ats.arjuna.coordinator.BasicAction
Abort, abortStatus, activate, activate, activeThreads, add, addChildAction, addChildThread, addChildThread, addRecord, Begin, checkForCurrent, childTransactions, commitStatus, criticalEnd, criticalStart, Current, deactivate, destroy, doAbort, doAbort, doCommit, doCommit, doPrepare, doPrepare, End, equals, finalize, forgetHeuristics, getHeuristicDecision, getHierarchy, getSavingUid, getStore, hierarchyDepth, insertRecord, isAncestor, maintainHeuristics, onePhaseCommit, parent, phase2Abort, phase2Cleanup, phase2Commit, prepare, preparedStatus, preventCommit, removeChildAction, removeChildThread, removeChildThread, restore_state, save_state, setCheckedAction, status, store, topLevelAction, topLevelActionUid, toString, typeOfAction, updateHeuristic, updateState
 
Methods inherited from class com.arjuna.ats.arjuna.StateManager
attributes, cleanup, deactivate, deactivate, disable, forgetAction, get_uid, getMutex, getStoreRoot, loadObjectState, lockMutex, modified, ObjectType, packHeader, persist, print, rememberAction, setStatus, setupStore, setupStore, terminate, tryLockMutex, unlockMutex, unpackHeader
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.arjuna.ats.arjuna.coordinator.Reapable
get_uid, preventCommit
 

Constructor Detail

TwoPhaseCoordinator

public TwoPhaseCoordinator()

TwoPhaseCoordinator

public TwoPhaseCoordinator(Uid id)

TwoPhaseCoordinator

protected TwoPhaseCoordinator(int at)

TwoPhaseCoordinator

protected TwoPhaseCoordinator(Uid u,
                              int at)
Method Detail

start

public int start()

start

public int start(BasicAction parentAction)

end

public int end(boolean report_heuristics)

cancel

public int cancel()
Specified by:
cancel in interface Reapable

addSynchronization

public int addSynchronization(SynchronizationRecord sr)

running

public boolean running()
Specified by:
running in interface Reapable
Returns:
true if the transaction is running, false otherwise.

type

public java.lang.String type()
Overloads BasicAction.type()

Overrides:
type in class BasicAction

beforeCompletion

protected boolean beforeCompletion()

afterCompletion

protected boolean afterCompletion(int myStatus)