public class AtomicAction extends TwoPhaseCoordinator
Modifier and Type | Field and Description |
---|---|
static int |
NO_TIMEOUT |
failedList, heuristicList, pendingList, preparedList, readonlyList, savedIntentionList
modifyingActions, objectModel, objectUid, usingActions
Modifier | Constructor and Description |
---|---|
|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
addSynchronization, afterCompletion, afterCompletion, beforeCompletion, getDeferredThrowable, getSynchronizations, running, start, start
Abort, abortStatus, activate, activate, activeThreads, add, addChildAction, addChildThread, addChildThread, addRecord, async_prepare, 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
cleanup, createLists, 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
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
get_uid, preventCommit
public static final int NO_TIMEOUT
public AtomicAction()
public AtomicAction(Uid objUid)
protected AtomicAction(int at)
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.Copyright © 2013. All Rights Reserved.