Class AmqpTransactionContext
java.lang.Object
org.apache.qpid.jms.provider.amqp.AmqpTransactionContext
- All Implemented Interfaces:
AmqpResourceParent
Handles the operations surrounding AMQP transaction control.
The Transaction will carry a JmsTransactionId while the Transaction is open, once a
transaction has been committed or rolled back the Transaction Id is cleared.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionAmqpTransactionContext(AmqpSession session, JmsSessionInfo resourceInfo) Creates a new AmqpTransactionContext instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChildResource(AmqpResource resource) Adds the given resource as a child of this resource so that it's lifetime becomes managed by that of its parent.voidbegin(JmsTransactionId txId, AsyncResult request) voidcommit(JmsTransactionInfo transactionInfo, JmsTransactionInfo nextTransactionInfo, AsyncResult request) org.apache.qpid.proton.amqp.Binaryorg.apache.qpid.proton.amqp.transaction.TransactionalStateorg.apache.qpid.proton.amqp.transaction.TransactionalStatebooleanisInTransaction(JmsConsumerId consumerId) booleanisInTransaction(JmsProducerId producerId) booleanvoidregisterTxConsumer(AmqpConsumer consumer) voidregisterTxProducer(AmqpProducer producer) voidremoveChildResource(AmqpResource resource) Removes the given resource from the registered child resources managed by this one.voidrollback(JmsTransactionInfo transactionInfo, JmsTransactionInfo nextTransactionInfo, AsyncResult request) toString()
-
Constructor Details
-
AmqpTransactionContext
Creates a new AmqpTransactionContext instance.- Parameters:
session- The session that owns this transaction context.resourceInfo- The resourceInfo that defines this transaction context.
-
-
Method Details
-
begin
- Throws:
ProviderException
-
commit
public void commit(JmsTransactionInfo transactionInfo, JmsTransactionInfo nextTransactionInfo, AsyncResult request) throws ProviderException - Throws:
ProviderException
-
rollback
public void rollback(JmsTransactionInfo transactionInfo, JmsTransactionInfo nextTransactionInfo, AsyncResult request) throws ProviderException - Throws:
ProviderException
-
registerTxConsumer
-
isInTransaction
-
registerTxProducer
-
isInTransaction
-
getSession
-
getTxnAcceptState
public org.apache.qpid.proton.amqp.transaction.TransactionalState getTxnAcceptState() -
getTxnEnrolledState
public org.apache.qpid.proton.amqp.transaction.TransactionalState getTxnEnrolledState() -
getTransactionId
-
isTransactionInDoubt
public boolean isTransactionInDoubt() -
getAmqpTransactionId
public org.apache.qpid.proton.amqp.Binary getAmqpTransactionId() -
toString
-
addChildResource
Description copied from interface:AmqpResourceParentAdds the given resource as a child of this resource so that it's lifetime becomes managed by that of its parent.- Specified by:
addChildResourcein interfaceAmqpResourceParent- Parameters:
resource- The AmqpResource that is a child of this one.
-
removeChildResource
Description copied from interface:AmqpResourceParentRemoves the given resource from the registered child resources managed by this one.- Specified by:
removeChildResourcein interfaceAmqpResourceParent- Parameters:
resource- The AmqpResource that is no longer a child of this one.
-
getProvider
- Specified by:
getProviderin interfaceAmqpResourceParent- Returns:
- a reference to the root AmqpProvider.
-