code: @Override
      public final void channelRead(final ChannelHandlerContext ctx, final Object msg) {
          try {
              JNRPERequest req = (JNRPERequest) msg;
  
              ReturnValue ret = commandInvoker.invoke(req.getCommand(), req.getArguments());
  
              JNRPEResponse res = new JNRPEResponse();
              res.setResult(ret.getStatus().intValue(), ret.getMessage());
  
              ChannelFuture channelFuture = ctx.writeAndFlush(res);
              channelFuture.addListener(ChannelFutureListener.CLOSE);
          } catch ( RuntimeException re ) {
              re.printStackTrace();
          } finally {
              ReferenceCountUtil.release(msg);
          }
      }
docs: Method channelRead.
  @param ctx ChannelHandlerContext
  @param msg Object
  @see io.netty.channel.ChannelInboundHandler#channelRead(ChannelHandlerContext, Object)