Class AMQDecoder<T extends MethodProcessor>

  • Direct Known Subclasses:
    ServerDecoder

    public abstract class AMQDecoder<T extends MethodProcessor>
    extends java.lang.Object
    AMQDecoder delegates the decoding of AMQP either to a data block decoder, or in the case of new connections, to a protocol initiation decoder. It is a cumulative decoder, which means that it can accumulate data to decode in the buffer until there is enough data to decode.

    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.

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AMQDecoder​(boolean expectProtocolInitiation, T methodProcessor)
      Creates a new AMQP decoder.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected int decodable​(org.apache.qpid.server.bytebuffer.QpidByteBuffer in)  
      protected int decode​(org.apache.qpid.server.bytebuffer.QpidByteBuffer buf)  
      T getMethodProcessor()  
      protected AMQFrameDecodingException newUnknownMethodException​(int classId, int methodId, ProtocolVersion protocolVersion)  
      protected int processAMQPFrames​(org.apache.qpid.server.bytebuffer.QpidByteBuffer buf)  
      protected void processFrame​(int channel, byte type, long bodySize, org.apache.qpid.server.bytebuffer.QpidByteBuffer in)  
      protected void processInput​(org.apache.qpid.server.bytebuffer.QpidByteBuffer in)  
      protected abstract void processMethod​(int channelId, org.apache.qpid.server.bytebuffer.QpidByteBuffer in)  
      void setExpectProtocolInitiation​(boolean expectProtocolInitiation)
      Sets the protocol initiation flag, that determines whether decoding is handled by the data decoder of the protocol initiation decoder.
      void setMaxFrameSize​(int frameMax)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AMQDecoder

        protected AMQDecoder​(boolean expectProtocolInitiation,
                             T methodProcessor)
        Creates a new AMQP decoder.
        Parameters:
        expectProtocolInitiation - true if this decoder needs to handle protocol initiation.
        methodProcessor - method processor