Class ProtonTransactionImpl

java.lang.Object
org.apache.activemq.artemis.core.transaction.impl.TransactionImpl
org.apache.activemq.artemis.protocol.amqp.proton.transaction.ProtonTransactionImpl
All Implemented Interfaces:
org.apache.activemq.artemis.core.transaction.Transaction

public class ProtonTransactionImpl extends org.apache.activemq.artemis.core.transaction.impl.TransactionImpl
AMQP Protocol has different TX Rollback behaviour for Acks depending on whether an AMQP delivery has been settled or not. This class extends the Core TransactionImpl used for normal TX behaviour. In the case where deliveries have been settled, normal Ack rollback is applied. For cases where deliveries are unsettled and rolled back, we increment the delivery count and return to the consumer.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apache.activemq.artemis.core.transaction.Transaction

    org.apache.activemq.artemis.core.transaction.Transaction.State
  • Field Summary

    Fields inherited from class org.apache.activemq.artemis.core.transaction.impl.TransactionImpl

    containsPersistent, id, state, storageManager, xid
  • Constructor Summary

    Constructors
    Constructor
    Description
    ProtonTransactionImpl(Xid xid, org.apache.activemq.artemis.core.persistence.StorageManager storageManager, int timeoutSeconds, AMQPConnectionContext connection)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addDelivery(org.apache.qpid.proton.engine.Delivery delivery, ProtonServerSenderContext context)
     
    void
     
    org.apache.activemq.artemis.core.server.impl.RefsOperation
    createRefsOperation(org.apache.activemq.artemis.core.server.Queue queue, org.apache.activemq.artemis.core.server.impl.AckReason reason)
     
    void
     
    Map<org.apache.activemq.artemis.core.server.MessageReference, Pair<org.apache.qpid.proton.engine.Delivery, ProtonServerSenderContext>>
     
    boolean
     
    void
     

    Methods inherited from class org.apache.activemq.artemis.core.transaction.impl.TransactionImpl

    addOperation, afterCommit, afterStore, afterWired, commit, delay, delayDone, doCommit, doRollback, getAllOperations, getCreateTime, getID, getPendingDelay, getProperty, getProtocolData, getRequiredConsistency, getState, getXid, hasTimedOut, hasTimedOut, isAsync, isContainsPersistent, isEffective, markAsRollbackOnly, prepare, putProperty, resume, setAsync, setContainsPersistent, setProtocolData, setState, setTimeout, suspend, toString, tryRollback

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.activemq.artemis.core.transaction.Transaction

    isAllowPageTransaction
  • Constructor Details

    • ProtonTransactionImpl

      public ProtonTransactionImpl(Xid xid, org.apache.activemq.artemis.core.persistence.StorageManager storageManager, int timeoutSeconds, AMQPConnectionContext connection)
  • Method Details

    • createRefsOperation

      public org.apache.activemq.artemis.core.server.impl.RefsOperation createRefsOperation(org.apache.activemq.artemis.core.server.Queue queue, org.apache.activemq.artemis.core.server.impl.AckReason reason)
      Specified by:
      createRefsOperation in interface org.apache.activemq.artemis.core.transaction.Transaction
      Overrides:
      createRefsOperation in class org.apache.activemq.artemis.core.transaction.impl.TransactionImpl
    • rollback

      public void rollback() throws Exception
      Specified by:
      rollback in interface org.apache.activemq.artemis.core.transaction.Transaction
      Overrides:
      rollback in class org.apache.activemq.artemis.core.transaction.impl.TransactionImpl
      Throws:
      Exception
    • addDelivery

      public void addDelivery(org.apache.qpid.proton.engine.Delivery delivery, ProtonServerSenderContext context)
    • getDeliveries

      public Map<org.apache.activemq.artemis.core.server.MessageReference, Pair<org.apache.qpid.proton.engine.Delivery, ProtonServerSenderContext>> getDeliveries()
    • commit

      public void commit() throws Exception
      Specified by:
      commit in interface org.apache.activemq.artemis.core.transaction.Transaction
      Overrides:
      commit in class org.apache.activemq.artemis.core.transaction.impl.TransactionImpl
      Throws:
      Exception
    • isDischarged

      public boolean isDischarged()
    • discharge

      public void discharge()