Class ProtonAbstractReceiver

    • Field Detail

      • receiver

        protected final org.apache.qpid.proton.engine.Receiver receiver
      • minLargeMessageSize

        protected final int minLargeMessageSize
      • routingContext

        protected final org.apache.activemq.artemis.core.server.RoutingContext routingContext
      • creditRunnable

        protected final Runnable creditRunnable
      • useModified

        protected final boolean useModified
      • pendingSettles

        protected int pendingSettles
    • Method Detail

      • isBellowThreshold

        public static boolean isBellowThreshold​(int credit,
                                                int pending,
                                                int threshold)
      • calculatedUpdateRefill

        public static int calculatedUpdateRefill​(int refill,
                                                 int credits,
                                                 int pending)
      • recoverContext

        protected void recoverContext()
      • clearLargeMessage

        protected void clearLargeMessage()
      • createCreditRunnable

        protected Runnable createCreditRunnable​(AMQPConnectionContext connection)
        Subclass can override this to provide a custom credit runnable that performs other checks or applies credit in a manner more fitting that implementation.
        Parameters:
        connection - The AMQPConnectionContext that this resource falls under.
        Returns:
        a Runnable that will perform the actual credit granting operation.
      • getConfiguredMinLargeMessageSize

        protected int getConfiguredMinLargeMessageSize​(AMQPConnectionContext connection)
        Subclass can override this to provide the minimum large message size that should be used when creating receiver instances.
        Parameters:
        connection - The AMQPConnectionContext that this resource falls under.
        Returns:
        the minimum large message size configuration value for this receiver.
      • createCreditRunnable

        public static Runnable createCreditRunnable​(int refill,
                                                    int threshold,
                                                    org.apache.qpid.proton.engine.Receiver receiver,
                                                    AMQPConnectionContext connection,
                                                    ProtonAbstractReceiver context)
        This Credit Runnable can be used to manage the credit replenishment of a target AMQP receiver.
        Parameters:
        refill - The number of credit to top off the receiver to
        threshold - The low water mark for credit before refill is done
        receiver - The proton receiver that will have its credit refilled
        connection - The connection that own the receiver
        context - The context that will be associated with the receiver
        Returns:
        A new Runnable that can be used to keep receiver credit replenished.
      • createCreditRunnable

        public static Runnable createCreditRunnable​(int refill,
                                                    int threshold,
                                                    org.apache.qpid.proton.engine.Receiver receiver,
                                                    AMQPConnectionContext connection)
        This Credit Runnable can be used to manage the credit replenishment of a target AMQP receiver.

        This method is generally used for tests as it does not account for the receiver context that is assigned to the given receiver instance which does not allow for tracking pending settles.

        Parameters:
        refill - The number of credit to top off the receiver to
        threshold - The low water mark for credit before refill is done
        receiver - The proton receiver that will have its credit refilled
        connection - The connection that own the receiver
        Returns:
        A new Runnable that can be used to keep receiver credit replenished.
      • incrementSettle

        public void incrementSettle()
      • settle

        public void settle​(org.apache.qpid.proton.engine.Delivery settlement)
      • initializeCurrentLargeMessage

        protected void initializeCurrentLargeMessage​(org.apache.qpid.proton.engine.Delivery delivery,
                                                     org.apache.qpid.proton.engine.Receiver receiver)
                                              throws Exception
        Throws:
        Exception
      • actualDelivery

        protected abstract void actualDelivery​(AMQPMessage message,
                                               org.apache.qpid.proton.engine.Delivery delivery,
                                               org.apache.qpid.proton.engine.Receiver receiver,
                                               org.apache.activemq.artemis.core.transaction.Transaction tx)
      • flow

        public abstract void flow()