|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.arjuna.ats.arjuna.StateManager com.arjuna.ats.arjuna.coordinator.BasicAction com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator com.arjuna.ats.arjuna.AtomicAction
public class AtomicAction
This is a user-level transaction class, unlike BasicAction. AtomicAction takes care of thread-to-action scoping. This is a "one-shot" object, i.e., once terminated, the instance cannot be re-used for another transaction. An instance of this class is a transaction that can be started and terminated (either committed or rolled back). There are also methods to allow participants (AbstractRecords) to be enlisted with the transaction and to associate/disassociate threads with the transaction.
Field Summary | |
---|---|
static int |
NO_TIMEOUT
|
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, objectModel, objectUid, usingActions |
Constructor Summary | |
---|---|
|
AtomicAction()
Create a new transaction. |
protected |
AtomicAction(int at)
Create a new transaction of the specified type. |
|
AtomicAction(Uid objUid)
AtomicAction constructor with a Uid. |
Method Summary | |
---|---|
int |
abort()
Abort (rollback) the transaction. |
boolean |
addThread()
Register the current thread with the transaction. |
boolean |
addThread(Thread t)
Register the specified thread with the transaction. |
int |
begin()
Start the transaction running. |
int |
begin(int timeout)
Start the transaction running. |
int |
cancel()
|
protected boolean |
checkForCurrent()
By default the BasicAction class only allows the termination of a transaction if it's the one currently associated with the thread. |
int |
commit()
Commit the transaction, and have heuristic reporting. |
int |
commit(boolean report_heuristics)
Commit the transaction. |
int |
end(boolean report_heuristics)
|
int |
getTimeout()
|
boolean |
removeThread()
Unregister the current thread from the transaction. |
boolean |
removeThread(Thread t)
Unregister the specified thread from the transaction. |
static boolean |
resume(AtomicAction act)
Resume transaction association on the current thread. |
static AtomicAction |
suspend()
Suspend all transaction association from the invoking thread. |
String |
type()
The type of the class is used to locate the state of the transaction log in the object store. |
Methods inherited from class com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator |
---|
addSynchronization, afterCompletion, afterCompletion, beforeCompletion, getDeferredThrowable, getSynchronizations, running, start, start |
Methods inherited from class com.arjuna.ats.arjuna.coordinator.BasicAction |
---|
Abort, abortStatus, activate, activate, activeThreads, add, addChildAction, addChildThread, addChildThread, addRecord, Begin, childTransactions, commitStatus, criticalEnd, criticalStart, Current, deactivate, destroy, doAbort, doAbort, doCommit, doCommit, doPrepare, End, equals, finalizeInternal, forgetHeuristics, getHeuristicDecision, getHierarchy, getSavingUid, getStore, hashCode, hierarchyDepth, insertRecord, isAncestor, maintainHeuristics, onePhaseCommit, parent, phase2Abort, phase2Cleanup, phase2Commit, prepare, preparedStatus, preventCommit, removeChildAction, removeChildThread, removeChildThread, restore_state, save_state, setCheckedAction, setHeuristicDecision, status, topLevelAction, topLevelActionUid, toString, typeOfAction, updateHeuristic, updateState |
Methods inherited from class com.arjuna.ats.arjuna.StateManager |
---|
cleanup, deactivate, deactivate, disable, forgetAction, get_uid, getMutex, getObjectModel, getStoreRoot, loadObjectState, lockMutex, modified, objectType, packHeader, persist, print, rememberAction, setStatus, setupStore, setupStore, setupStore, terminate, tryLockMutex, unlockMutex, unpackHeader |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.arjuna.ats.arjuna.coordinator.Reapable |
---|
get_uid, preventCommit |
Field Detail |
---|
public static final int NO_TIMEOUT
Constructor Detail |
---|
public AtomicAction()
public AtomicAction(Uid objUid)
protected AtomicAction(int at)
Method Detail |
---|
public int begin()
ActionStatus
indicating outcome.public int begin(int timeout)
timeout
- the timeout associated with the transaction. If the
transaction is still active when this timeout elapses, the
system will automatically roll it back.
ActionStatus
indicating outcome.public int commit()
ActionStatus
indicating outcome.public int commit(boolean report_heuristics)
ActionStatus
indicating outcome.public int abort()
ActionStatus
indicating outcome.public int end(boolean report_heuristics)
end
in class TwoPhaseCoordinator
public int cancel()
cancel
in interface Reapable
cancel
in class TwoPhaseCoordinator
public final int getTimeout()
public String type()
type
in class TwoPhaseCoordinator
public boolean addThread()
true
if successful, false
otherwise.public boolean addThread(Thread t)
true
if successful, false
otherwise.public boolean removeThread()
true
if successful, false
otherwise.public boolean removeThread(Thread t)
true
if successful, false
otherwise.public static final AtomicAction suspend()
public static final boolean resume(AtomicAction act)
act
- the transaction to associate. If this is a nested
transaction, then the thread will be associated with all of
the transactions in the hierarchy.
true
if association is successful,
false
otherwise.protected boolean checkForCurrent()
checkForCurrent
in class BasicAction
true
to indicate that this transaction can only be
terminated by the right thread.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |