Class SimpleChannelInboundHandler<I>

All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler
Direct Known Subclasses:
OcspHttpHandler

public abstract class SimpleChannelInboundHandler<I> extends ChannelInboundHandlerAdapter
ChannelInboundHandlerAdapter which allows to explicit only handle a specific type of messages. For example here is an implementation which only handle String messages.
     public class StringHandler extends
             SimpleChannelInboundHandler<String> {

         @Override
         protected void channelRead0(ChannelHandlerContext ctx, String message)
                 throws Exception {
             System.out.println(message);
         }
     }
 
Be aware that depending of the constructor parameters it will release all handled messages by passing them to ReferenceCountUtil.release(Object). In this case you may need to use ReferenceCountUtil.retain(Object) if you pass the object to the next handler in the ChannelPipeline.