Class SimpleUserEventChannelHandler<I>

All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler

public abstract class SimpleUserEventChannelHandler<I> extends ChannelInboundHandlerAdapter
ChannelInboundHandlerAdapter which allows to conveniently only handle a specific type of user events. For example, here is an implementation which only handle String user events.
     public class StringEventHandler extends
             SimpleUserEventChannelHandler<String> {

         @Override
         protected void eventReceived(ChannelHandlerContext ctx, String evt)
                 throws Exception {
             System.out.println(evt);
         }
     }
 
Be aware that depending of the constructor parameters it will release all handled events 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.