Class OutgoingAMQPEnvelope

    • Field Detail


        public static final byte AMQP_FRAME_TYPE
        The frame type value to used when encoding the outgoing AMQP frame.
        See Also:
        Constant Field Values
    • Method Detail

      • setPayloadToLargeHandler

        public OutgoingAMQPEnvelope setPayloadToLargeHandler​(java.util.function.Consumer<Performative> payloadToLargeHandler)
        Configures a handler to be invoked if the payload that is being transmitted with this performative is to large to allow encoding the frame within the maximum configured AMQP frame size limit.
        payloadToLargeHandler - Handler that will update the Performative to reflect that more than one frame is required.
        this OutgoingAMQPEnvelope instance.
      • handlePayloadToLarge

        public OutgoingAMQPEnvelope handlePayloadToLarge()
        Called when the encoder determines that the encoding of the Performative plus any payload value is to large for a single AMQP frame. The configured handler should update the Performative in preparation for encoding as a split framed AMQP transfer.
        this OutgoingAMQPEnvelope instance
      • setFrameWriteCompletionHandler

        public OutgoingAMQPEnvelope setFrameWriteCompletionHandler​(java.lang.Runnable frameWriteCompleteHandler)
        Configures a handler to be invoked when a write operation that was handed off to the I/O layer has completed indicated that a single frame portion of the payload has been fully written.
        frameWriteCompleteHandler - Runnable handler that will update state or otherwise respond to the write of a frame.
        this OutgoingAMQPEnvelope instance.
      • handleOutgoingFrameWriteComplete

        public OutgoingAMQPEnvelope handleOutgoingFrameWriteComplete()
        Called by the encoder when the write of a frame that comprises the transfer of the AMQP Performative plus any assigned payload has completed. If the transfer comprises multiple frame writes this handler should be invoked as each frame is successfully written by the IO layer.
        this OutgoingAMQPEnvelope instance.
      • release

        public void release()
        Used to release a Frame that was taken from a Frame pool in order to make it available for the next input operations. Once called the contents of the Frame are invalid and cannot be used again inside the same context.
      • invoke

        public <E> void invoke​(Performative.PerformativeHandler<E> handler,
                               E context)
        Invoke the correct PerformativeHandler event based on the body of this OutgoingAMQPEnvelope
        Type Parameters:
        E - The type that the Performative handler expects for the context value.
        handler - The handler that should be used to process the current body value.
        context - The context that should be passed along for the current event.