Class AmqpSession

    • Constructor Detail

    • Method Detail

      • acknowledge

        public void acknowledge​(ProviderConstants.ACK_TYPE ackType)
        Perform an acknowledge of all delivered messages for all consumers active in this Session.
        Parameters:
        ackType - controls the acknowledgement that is applied to each message.
      • recover

        public void recover()
                     throws java.lang.Exception
        Perform re-send of all delivered but not yet acknowledged messages for all consumers active in this Session.
        Throws:
        java.lang.Exception - if an error occurs while performing the recover.
      • begin

        public void begin​(JmsTransactionId txId,
                          AsyncResult request)
                   throws java.lang.Exception
        Begins a new Transaction using the given Transaction Id as the identifier. The AMQP binary Transaction Id will be stored in the provider hint value of the given transaction.
        Parameters:
        txId - The JMS Framework's assigned Transaction Id for the new TX.
        request - The request that will be signaled on completion of this operation.
        Throws:
        java.lang.Exception - if an error occurs while performing the operation.
      • commit

        public void commit​(JmsTransactionInfo transactionInfo,
                           JmsTransactionInfo nextTransactionInfo,
                           AsyncResult request)
                    throws java.lang.Exception
        Commit the currently running Transaction.
        Parameters:
        transactionInfo - the JmsTransactionInfo describing the transaction being committed.
        nextTransactionInfo - the JmsTransactionInfo describing the transaction that should be started immediately.
        request - The request that will be signaled on completion of this operation.
        Throws:
        java.lang.Exception - if an error occurs while performing the operation.
      • rollback

        public void rollback​(JmsTransactionInfo transactionInfo,
                             JmsTransactionInfo nextTransactionInfo,
                             AsyncResult request)
                      throws java.lang.Exception
        Roll back the currently running Transaction
        Parameters:
        transactionInfo - the JmsTransactionInfo describing the transaction being rolled back.
        nextTransactionInfo - the JmsTransactionInfo describing the transaction that should be started immediately.
        request - The request that will be signaled on completion of this operation.
        Throws:
        java.lang.Exception - if an error occurs while performing the operation.
      • schedule

        public java.util.concurrent.ScheduledFuture<?> schedule​(java.lang.Runnable task,
                                                                long delay)
        Allows a session resource to schedule a task for future execution.
        Parameters:
        task - The Runnable task to be executed after the given delay.
        delay - The delay in milliseconds to schedule the given task for execution.
        Returns:
        a ScheduledFuture instance that can be used to cancel the task.
      • addChildResource

        public void addChildResource​(AmqpResource resource)
        Description copied from interface: AmqpResourceParent
        Adds the given resource as a child of this resource so that it's lifetime becomes managed by that of its parent.
        Specified by:
        addChildResource in interface AmqpResourceParent
        Parameters:
        resource - The AmqpResource that is a child of this one.
      • removeChildResource

        public void removeChildResource​(AmqpResource resource)
        Description copied from interface: AmqpResourceParent
        Removes the given resource from the registered child resources managed by this one.
        Specified by:
        removeChildResource in interface AmqpResourceParent
        Parameters:
        resource - The AmqpResource that is no longer a child of this one.
      • reportError

        public void reportError​(ProviderException error)
        Call to send an error that occurs outside of the normal asynchronous processing of a session resource such as a remote close etc.
        Parameters:
        error - The error to forward on to the Provider error event handler.
      • isTransactionInDoubt

        public boolean isTransactionInDoubt()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object