Interface ClientTransactionContext


  • public interface ClientTransactionContext
    Base for a Transaction Context used in ClientSession instances to mask from the senders and receivers the work of deciding transaction specific behaviors.
    • Method Detail

      • isInTransaction

        boolean isInTransaction()
        Returns:
        true if the context is hosting an active transaction.
      • isRollbackOnly

        boolean isRollbackOnly()
        Returns:
        true if there is an active transaction but its state is failed an will roll-back
      • send

        ClientTransactionContext send​(ClientOutgoingEnvelope envelope,
                                      DeliveryState state,
                                      boolean settled)
        Enlist the given outgoing envelope into this transaction if one is active and not already in a roll-back only state. If the transaction is failed the context should discard the envelope which should appear to the caller as if the send was successful.
        Parameters:
        envelope - The envelope containing the details and mechanisms for sending the message.
        state - The delivery state that is being applied as the outcome of the delivery.
        settled - The settlement value that is being requested for the delivery.
        Returns:
        this ClientTransactionContext instance.
      • disposition

        ClientTransactionContext disposition​(IncomingDelivery delivery,
                                             DeliveryState state,
                                             boolean settled)
        Apply a disposition to the given delivery wrapping it with a TransactionalState outcome if there is an active transaction. If there is no active transaction than the context will apply the disposition as requested but if there is an active transaction then the disposition must be wrapped in a TransactionalState and settlement should always enforced by the client.
        Parameters:
        delivery - The incoming delivery that the receiver is applying a disposition to.
        state - The delivery state that is being applied as the outcome of the delivery.
        settled - The settlement value that is being requested for the delivery.
        Returns:
        this ClientTransactionContext instance.