Uploaded image for project: 'Netty'
  1. Netty
  2. NETTY-405

Netty decoders should have a reusable public method which is independent of channel handler context

    Details

    • Estimated Difficulty:
      Low

      Description

      Codec is merely a simple handler, which means it's designed to be used only in a ChannelPipeline. However, codec should be allowed to be called from outside the pipeline.
      Since encode/decode method is a protected as below
      @Override
      protected Object encode(
      ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception {
      if (!(msg instanceof String))

      { return msg; }

      return copiedBuffer((String) msg, charset);
      }
      It is required to inherit it in a wrapper class to use it. A new public method should be added to these codecs which will not require the ctx and channel, they just do the decode/encode and give back result. Expectation is a method like follows
      public Object decode(Object msg); on the codecs

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                trustin Trustin Lee
                Reporter:
                menacher Abraham Menacherry
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: