Package org.apache.activemq.transaction
Class Transaction
- java.lang.Object
-
- org.apache.activemq.transaction.Transaction
-
- Direct Known Subclasses:
LocalTransaction
,XATransaction
public abstract class Transaction extends Object
Keeps track of all the actions the need to be done when a transaction does a commit or rollback.
-
-
Field Summary
Fields Modifier and Type Field Description static byte
FINISHED_STATE
static byte
IN_USE_STATE
protected FutureTask<?>
postCommitTask
protected FutureTask<?>
preCommitTask
static byte
PREPARED_STATE
static byte
START_STATE
-
Constructor Summary
Constructors Constructor Description Transaction()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addSynchronization(Synchronization r)
abstract void
commit(boolean onePhase)
protected void
doPostCommit()
protected void
doPreCommit()
Synchronization
findMatching(Synchronization r)
protected void
fireAfterCommit()
void
fireAfterRollback()
protected void
fireBeforeCommit()
abstract org.slf4j.Logger
getLog()
byte
getState()
abstract TransactionId
getTransactionId()
boolean
isCommitted()
boolean
isPrepared()
boolean
isRollbackOnly()
static XAException
newXAException(String s, int errorCode)
abstract int
prepare()
void
prePrepare()
void
removeSynchronization(Synchronization r)
abstract void
rollback()
void
setCommitted(boolean committed)
void
setRollbackOnly(Throwable cause)
void
setState(byte state)
int
size()
String
toString()
protected void
waitPostCommitDone(FutureTask<?> postCommitTask)
-
-
-
Field Detail
-
START_STATE
public static final byte START_STATE
- See Also:
- Constant Field Values
-
IN_USE_STATE
public static final byte IN_USE_STATE
- See Also:
- Constant Field Values
-
PREPARED_STATE
public static final byte PREPARED_STATE
- See Also:
- Constant Field Values
-
FINISHED_STATE
public static final byte FINISHED_STATE
- See Also:
- Constant Field Values
-
preCommitTask
protected FutureTask<?> preCommitTask
-
postCommitTask
protected FutureTask<?> postCommitTask
-
-
Method Detail
-
getState
public byte getState()
-
setState
public void setState(byte state)
-
isCommitted
public boolean isCommitted()
-
setCommitted
public void setCommitted(boolean committed)
-
addSynchronization
public void addSynchronization(Synchronization r)
-
findMatching
public Synchronization findMatching(Synchronization r)
-
removeSynchronization
public void removeSynchronization(Synchronization r)
-
commit
public abstract void commit(boolean onePhase) throws XAException, IOException
- Throws:
XAException
IOException
-
rollback
public abstract void rollback() throws XAException, IOException
- Throws:
XAException
IOException
-
prepare
public abstract int prepare() throws XAException, IOException
- Throws:
XAException
IOException
-
getTransactionId
public abstract TransactionId getTransactionId()
-
getLog
public abstract org.slf4j.Logger getLog()
-
isPrepared
public boolean isPrepared()
-
size
public int size()
-
waitPostCommitDone
protected void waitPostCommitDone(FutureTask<?> postCommitTask) throws XAException, IOException
- Throws:
XAException
IOException
-
doPreCommit
protected void doPreCommit() throws XAException
- Throws:
XAException
-
doPostCommit
protected void doPostCommit() throws XAException
- Throws:
XAException
-
newXAException
public static XAException newXAException(String s, int errorCode)
-
setRollbackOnly
public void setRollbackOnly(Throwable cause)
-
isRollbackOnly
public boolean isRollbackOnly()
-
-