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(ByteBuffer in) |
protected int |
decode(ByteBuffer buf) |
T |
getMethodProcessor() |
protected int |
processAMQPFrames(ByteBuffer buf) |
protected void |
processFrame(int channel,
byte type,
long bodySize,
ByteBuffer in) |
protected void |
processInput(ByteBuffer 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(ByteBuffer buf) throws AMQFrameDecodingException
AMQFrameDecodingExceptionprotected int processAMQPFrames(ByteBuffer buf) throws AMQFrameDecodingException
AMQFrameDecodingExceptionprotected int decodable(ByteBuffer in) throws AMQFrameDecodingException
AMQFrameDecodingExceptionprotected void processInput(ByteBuffer in) throws AMQFrameDecodingException, AMQProtocolVersionException
protected void processFrame(int channel,
byte type,
long bodySize,
ByteBuffer in)
throws AMQFrameDecodingException
AMQFrameDecodingExceptionCopyright © 2006–2018 The Apache Software Foundation. All rights reserved.