Package org.apache.qpid.protonj2.engine
Class OutgoingAMQPEnvelope
java.lang.Object
org.apache.qpid.protonj2.engine.PerformativeEnvelope<Performative>
org.apache.qpid.protonj2.engine.OutgoingAMQPEnvelope
Frame object that carries an AMQP Performative
-
Field Summary
Modifier and TypeFieldDescriptionstatic final byte
The frame type value to used when encoding the outgoing AMQP frame. -
Method Summary
Modifier and TypeMethodDescriptionCalled by the encoder when the write of a frame that comprises the transfer of the AMQPPerformative
plus any assigned payload has completed.Called when the encoder determines that the encoding of thePerformative
plus any payload value is to large for a single AMQP frame.<E> void
invoke
(Performative.PerformativeHandler<E> handler, E context) Invoke the correct PerformativeHandler event based on the body of thisOutgoingAMQPEnvelope
final 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.setFrameWriteCompletionHandler
(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.setPayloadToLargeHandler
(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.Methods inherited from class org.apache.qpid.protonj2.engine.PerformativeEnvelope
getBody, getChannel, getFrameType, getPayload, toString
-
Field Details
-
AMQP_FRAME_TYPE
public static final byte AMQP_FRAME_TYPEThe frame type value to used when encoding the outgoing AMQP frame.- See Also:
-
-
Method Details
-
setPayloadToLargeHandler
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.- Parameters:
payloadToLargeHandler
- Handler that will update the Performative to reflect that more than one frame is required.- Returns:
- this
OutgoingAMQPEnvelope
instance.
-
handlePayloadToLarge
Called when the encoder determines that the encoding of thePerformative
plus any payload value is to large for a single AMQP frame. The configured handler should update thePerformative
in preparation for encoding as a split framed AMQP transfer.- Returns:
- this
OutgoingAMQPEnvelope
instance
-
setFrameWriteCompletionHandler
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.- Parameters:
frameWriteCompleteHandler
- Runnable handler that will update state or otherwise respond to the write of a frame.- Returns:
- this
OutgoingAMQPEnvelope
instance.
-
handleOutgoingFrameWriteComplete
Called by the encoder when the write of a frame that comprises the transfer of the AMQPPerformative
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.- Returns:
- this
OutgoingAMQPEnvelope
instance.
-
release
public final 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
Invoke the correct PerformativeHandler event based on the body of thisOutgoingAMQPEnvelope
- Type Parameters:
E
- The type that thePerformative
handler expects for the context value.- Parameters:
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.
-