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 Details

  • Constructor Details

    • Transaction

      public Transaction()
  • Method Details

    • getState

      public byte getState()
    • setState

      public void setState(byte state)
    • isCommitted

      public boolean isCommitted()
    • setCommitted

      public void setCommitted(boolean committed)
    • addSynchronization

      public void addSynchronization(org.apache.activemq.transaction.Synchronization r)
    • findMatching

      public org.apache.activemq.transaction.Synchronization findMatching(org.apache.activemq.transaction.Synchronization r)
    • removeSynchronization

      public void removeSynchronization(org.apache.activemq.transaction.Synchronization r)
    • prePrepare

      public void prePrepare() throws Exception
      Throws:
      Exception
    • fireBeforeCommit

      protected void fireBeforeCommit() throws Exception
      Throws:
      Exception
    • fireAfterCommit

      protected void fireAfterCommit() throws Exception
      Throws:
      Exception
    • fireAfterRollback

      public void fireAfterRollback() throws Exception
      Throws:
      Exception
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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 org.apache.activemq.command.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()