org.apache.activemq.transaction
Class Transaction

java.lang.Object
  extended by org.apache.activemq.transaction.Transaction
Direct Known Subclasses:
LocalTransaction, XATransaction

public abstract class Transaction
extends java.lang.Object

Keeps track of all the actions the need to be done when a transaction does a commit or rollback.


Field Summary
static byte FINISHED_STATE
           
static byte IN_USE_STATE
           
protected  java.util.concurrent.FutureTask<?> postCommitTask
           
protected  java.util.concurrent.FutureTask<?> preCommitTask
           
static byte PREPARED_STATE
           
static byte START_STATE
           
 
Constructor Summary
Transaction()
           
 
Method Summary
 void addSynchronization(Synchronization r)
           
abstract  void commit(boolean onePhase)
           
protected  void doPostCommit()
           
protected  void doPreCommit()
           
protected  void fireAfterCommit()
           
 void fireAfterRollback()
           
protected  void fireBeforeCommit()
           
abstract  org.slf4j.Logger getLog()
           
 byte getState()
           
abstract  TransactionId getTransactionId()
           
 boolean isPrepared()
           
abstract  int prepare()
           
 void prePrepare()
           
 void removeSynchronization(Synchronization r)
           
abstract  void rollback()
           
 void setState(byte state)
           
 int size()
           
 java.lang.String toString()
           
protected  void waitPostCommitDone(java.util.concurrent.FutureTask<?> postCommitTask)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 java.util.concurrent.FutureTask<?> preCommitTask

postCommitTask

protected java.util.concurrent.FutureTask<?> postCommitTask
Constructor Detail

Transaction

public Transaction()
Method Detail

getState

public byte getState()

setState

public void setState(byte state)

addSynchronization

public void addSynchronization(Synchronization r)

removeSynchronization

public void removeSynchronization(Synchronization r)

prePrepare

public void prePrepare()
                throws java.lang.Exception
Throws:
java.lang.Exception

fireBeforeCommit

protected void fireBeforeCommit()
                         throws java.lang.Exception
Throws:
java.lang.Exception

fireAfterCommit

protected void fireAfterCommit()
                        throws java.lang.Exception
Throws:
java.lang.Exception

fireAfterRollback

public void fireAfterRollback()
                       throws java.lang.Exception
Throws:
java.lang.Exception

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

commit

public abstract void commit(boolean onePhase)
                     throws javax.transaction.xa.XAException,
                            java.io.IOException
Throws:
javax.transaction.xa.XAException
java.io.IOException

rollback

public abstract void rollback()
                       throws javax.transaction.xa.XAException,
                              java.io.IOException
Throws:
javax.transaction.xa.XAException
java.io.IOException

prepare

public abstract int prepare()
                     throws javax.transaction.xa.XAException,
                            java.io.IOException
Throws:
javax.transaction.xa.XAException
java.io.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(java.util.concurrent.FutureTask<?> postCommitTask)
                           throws javax.transaction.xa.XAException,
                                  java.io.IOException
Throws:
javax.transaction.xa.XAException
java.io.IOException

doPreCommit

protected void doPreCommit()
                    throws javax.transaction.xa.XAException
Throws:
javax.transaction.xa.XAException

doPostCommit

protected void doPostCommit()
                     throws javax.transaction.xa.XAException
Throws:
javax.transaction.xa.XAException


Copyright © 2005-2011 FuseSource, Corp.. All Rights Reserved.