public void encode(IoSession session, Object message, ProtocolEncoderOutput out)
     throws Exception {
   if (message instanceof Message<?>) {
     byte[] rpcBytes = MessageCodec.encodeMessage((Message<?>) message);
     writeFrame(out, rpcBytes);
   }
 }
 @Override
 protected void encode(
     ChannelHandlerContext ctx, Message<? extends Serializable> message, ByteBuf out)
     throws Exception {
   byte[] rpcBytes = MessageCodec.encodeMessage(message);
   writeFrame(out, rpcBytes);
 }