Class BaseRespDecoder

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.handler.codec.ByteToMessageDecoder
org.infinispan.server.resp.BaseRespDecoder
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler
Direct Known Subclasses:
RespDecoder

public abstract class BaseRespDecoder extends io.netty.handler.codec.ByteToMessageDecoder
  • Nested Class Summary

    Nested classes/interfaces inherited from class io.netty.handler.codec.ByteToMessageDecoder

    io.netty.handler.codec.ByteToMessageDecoder.Cumulator

    Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

    io.netty.channel.ChannelHandler.Sharable
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final Log
     
    protected final org.infinispan.server.resp.Intrinsics.Resp2LongProcessor
     
    protected static final int
     
    protected io.netty.buffer.ByteBuf
     
     
    protected boolean
     

    Fields inherited from class io.netty.handler.codec.ByteToMessageDecoder

    COMPOSITE_CUMULATOR, MERGE_CUMULATOR
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected io.netty.buffer.ByteBuf
    allocateBuffer(io.netty.channel.ChannelHandlerContext ctx, int size)
     
    protected void
    attemptReadResume(io.netty.channel.ChannelHandlerContext ctx)
     
    void
    channelReadComplete(io.netty.channel.ChannelHandlerContext ctx)
     
    void
    channelRegistered(io.netty.channel.ChannelHandlerContext ctx)
     
    void
    channelUnregistered(io.netty.channel.ChannelHandlerContext ctx)
     
    void
    channelWritabilityChanged(io.netty.channel.ChannelHandlerContext ctx)
     
    void
    exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
     
    protected boolean
    handleCommandAndArguments(io.netty.channel.ChannelHandlerContext ctx, RespCommand command, List<byte[]> arguments)
    Handles the actual command request.

    Methods inherited from class io.netty.handler.codec.ByteToMessageDecoder

    actualReadableBytes, callDecode, channelInactive, channelRead, decode, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggered

    Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

    channelActive

    Methods inherited from class io.netty.channel.ChannelHandlerAdapter

    ensureNotSharable, handlerAdded, isSharable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.netty.channel.ChannelHandler

    handlerAdded
  • Field Details

    • log

      protected static final Log log
    • MINIMUM_BUFFER_SIZE

      protected static final int MINIMUM_BUFFER_SIZE
    • longProcessor

      protected final org.infinispan.server.resp.Intrinsics.Resp2LongProcessor longProcessor
    • requestHandler

      protected RespRequestHandler requestHandler
    • outboundBuffer

      protected io.netty.buffer.ByteBuf outboundBuffer
    • resumeAutoReadOnWritability

      protected boolean resumeAutoReadOnWritability
  • Constructor Details

    • BaseRespDecoder

      public BaseRespDecoder()
  • Method Details

    • allocateBuffer

      protected io.netty.buffer.ByteBuf allocateBuffer(io.netty.channel.ChannelHandlerContext ctx, int size)
    • channelRegistered

      public void channelRegistered(io.netty.channel.ChannelHandlerContext ctx) throws Exception
      Specified by:
      channelRegistered in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      channelRegistered in class io.netty.channel.ChannelInboundHandlerAdapter
      Throws:
      Exception
    • channelUnregistered

      public void channelUnregistered(io.netty.channel.ChannelHandlerContext ctx) throws Exception
      Specified by:
      channelUnregistered in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      channelUnregistered in class io.netty.channel.ChannelInboundHandlerAdapter
      Throws:
      Exception
    • channelReadComplete

      public void channelReadComplete(io.netty.channel.ChannelHandlerContext ctx) throws Exception
      Specified by:
      channelReadComplete in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      channelReadComplete in class io.netty.handler.codec.ByteToMessageDecoder
      Throws:
      Exception
    • channelWritabilityChanged

      public void channelWritabilityChanged(io.netty.channel.ChannelHandlerContext ctx) throws Exception
      Specified by:
      channelWritabilityChanged in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      channelWritabilityChanged in class io.netty.channel.ChannelInboundHandlerAdapter
      Throws:
      Exception
    • attemptReadResume

      protected void attemptReadResume(io.netty.channel.ChannelHandlerContext ctx)
    • handleCommandAndArguments

      protected boolean handleCommandAndArguments(io.netty.channel.ChannelHandlerContext ctx, RespCommand command, List<byte[]> arguments)
      Handles the actual command request. This entails passing the command to the request handler and if the request is completed the decoder may parse more commands.
      Parameters:
      ctx - channel context in use for this command
      command - the actual command
      arguments - the arguments provided to the command. The list should not be retained as it is reused
      Returns:
      boolean whether the decoder can read more bytes or must wait
    • exceptionCaught

      public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
      Specified by:
      exceptionCaught in interface io.netty.channel.ChannelHandler
      Specified by:
      exceptionCaught in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      exceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapter