public abstract class AMQDecoder<T extends MethodProcessor> extends Object
One instance of this class is created per session, so any changes or configuration done at run time to the decoder will only affect decoding of the protocol session data to which is it bound.
TODO If protocol initiation decoder not needed, then don't create it. Probably not a big deal, but it adds to the per-session overhead.
| Modifier and Type | Field and Description |
|---|---|
static int |
FRAME_HEADER_SIZE |
static int |
FRAME_MIN_SIZE |
| Modifier | Constructor and Description |
|---|---|
protected |
AMQDecoder(boolean expectProtocolInitiation,
T methodProcessor)
Creates a new AMQP decoder.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
decodable(QpidByteBuffer in) |
protected int |
decode(QpidByteBuffer buf) |
T |
getMethodProcessor() |
protected int |
processAMQPFrames(QpidByteBuffer buf) |
protected void |
processFrame(int channel,
byte type,
long bodySize,
QpidByteBuffer in) |
protected void |
processInput(QpidByteBuffer in) |
void |
setExpectProtocolInitiation(boolean expectProtocolInitiation)
Sets the protocol initation flag, that determines whether decoding is handled by the data decoder of the protocol
initation decoder.
|
void |
setMaxFrameSize(int frameMax) |
public static final int FRAME_HEADER_SIZE
public static final int FRAME_MIN_SIZE
protected AMQDecoder(boolean expectProtocolInitiation,
T methodProcessor)
expectProtocolInitiation - true if this decoder needs to handle protocol initiation.methodProcessor - method processorpublic void setExpectProtocolInitiation(boolean expectProtocolInitiation)
expectProtocolInitiation - true to use the protocol initiation decoder, false to use the
data decoder.public void setMaxFrameSize(int frameMax)
public T getMethodProcessor()
protected final int decode(QpidByteBuffer buf) throws AMQFrameDecodingException
AMQFrameDecodingExceptionprotected int processAMQPFrames(QpidByteBuffer buf) throws AMQFrameDecodingException
AMQFrameDecodingExceptionprotected int decodable(QpidByteBuffer in) throws AMQFrameDecodingException
AMQFrameDecodingExceptionprotected void processInput(QpidByteBuffer in) throws AMQFrameDecodingException, AMQProtocolVersionException
protected void processFrame(int channel,
byte type,
long bodySize,
QpidByteBuffer in)
throws AMQFrameDecodingException
AMQFrameDecodingExceptionCopyright © 2006–2018 The Apache Software Foundation. All rights reserved.