Class 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

        storageManager
    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addDelivery​(org.apache.qpid.proton.engine.Delivery delivery, ProtonServerSenderContext context)  
      void commit()  
      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 discharge()  
      java.util.Map<org.apache.activemq.artemis.core.server.MessageReference,​org.apache.activemq.artemis.api.core.Pair<org.apache.qpid.proton.engine.Delivery,​ProtonServerSenderContext>> getDeliveries()  
      boolean isDischarged()  
      void rollback()  
      • Methods inherited from class org.apache.activemq.artemis.core.transaction.impl.TransactionImpl

        addOperation, afterCommit, afterStore, commit, doCommit, doRollback, getAllOperations, getCreateTime, getID, getProperty, getProtocolData, getState, getXid, hasTimedOut, hasTimedOut, isContainsPersistent, isEffective, markAsRollbackOnly, prepare, putProperty, resume, setContainsPersistent, setProtocolData, setState, setTimeout, suspend, toString, tryRollback
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ProtonTransactionImpl

        public ProtonTransactionImpl​(javax.transaction.xa.Xid xid,
                                     org.apache.activemq.artemis.core.persistence.StorageManager storageManager,
                                     int timeoutSeconds,
                                     AMQPConnectionContext connection)
    • Method Detail

      • 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 java.lang.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:
        java.lang.Exception
      • addDelivery

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

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

        public void commit()
                    throws java.lang.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:
        java.lang.Exception
      • isDischarged

        public boolean isDischarged()
      • discharge

        public void discharge()