public class ImageControlledFragmentAssembler extends java.lang.Object implements ControlledFragmentHandler
ControlledFragmentHandler
that sits in a chain-of-responsibility pattern that reassembles fragmented
messages so that the next handler in the chain only sees whole messages. This is for a single session on an
Image
and not for multiple session Image
s in a Subscription
.
Unfragmented messages are delegated without copy. Fragmented messages are copied to a temporary buffer for reassembly before delegation.
The Header
passed to the delegate on assembling a message will be that of the last fragment.
ControlledFragmentHandler.Action
Constructor and Description |
---|
ImageControlledFragmentAssembler(ControlledFragmentHandler delegate)
Construct an adapter to reassemble message fragments and delegate on whole messages.
|
ImageControlledFragmentAssembler(ControlledFragmentHandler delegate,
int initialBufferLength)
Construct an adapter to reassemble message fragments and delegate on whole messages.
|
ImageControlledFragmentAssembler(ControlledFragmentHandler delegate,
int initialBufferLength,
boolean isDirectByteBuffer)
Construct an adapter to reassemble message fragments and delegate on whole messages.
|
Modifier and Type | Method and Description |
---|---|
ControlledFragmentHandler |
delegate()
Get the delegate unto which assembled messages are delegated.
|
ControlledFragmentHandler.Action |
onFragment(org.agrona.DirectBuffer buffer,
int offset,
int length,
Header header)
The implementation of
ControlledFragmentHandler that reassembles and forwards whole messages. |
public ImageControlledFragmentAssembler(ControlledFragmentHandler delegate)
delegate
- onto which whole messages are forwarded.public ImageControlledFragmentAssembler(ControlledFragmentHandler delegate, int initialBufferLength)
delegate
- onto which whole messages are forwarded.initialBufferLength
- to be used for the session.public ImageControlledFragmentAssembler(ControlledFragmentHandler delegate, int initialBufferLength, boolean isDirectByteBuffer)
delegate
- onto which whole messages are forwarded.initialBufferLength
- to be used for the session.isDirectByteBuffer
- is the underlying buffer to be a direct ByteBuffer
?public ControlledFragmentHandler delegate()
public ControlledFragmentHandler.Action onFragment(org.agrona.DirectBuffer buffer, int offset, int length, Header header)
ControlledFragmentHandler
that reassembles and forwards whole messages.onFragment
in interface ControlledFragmentHandler
buffer
- containing the data.offset
- at which the data begins.length
- of the data in bytes.header
- representing the meta data for the data.Copyright © 2014-2018 Real Logic Ltd. All Rights Reserved.