Hi Trustin

I read the source code(1.1.6)
ProtocolEncoderImpl<http://mina.apache.org/report/1.1/xref/org/apache/mina/filter/codec/demux/DemuxingProtocolCodecFactory.html>.


1)Set<Class<?>> messageTypes = encoder.getMessageTypes(); is used to get the
message of concrete encoder class.
2)in encode method:
Class<?> type = message.getClass();
MessageEncoder<http://mina.apache.org/report/1.1/xref/org/apache/mina/filter/codec/demux/MessageEncoder.html>encoder
= findEncoder(type); --How mina find out what encoder should be
used, right?

Therefore, if I have to register my concrete encoder class to TYPES and also
implement
 public Set<Class<?>> getMessageTypes() {
  return TYPES;
 }

However in your previous answer, you said getMessageTypes in NO use? Which
means in Mina2.0, it is NO use?

On Sep 28, 2007 10:51 PM, Trustin Lee <[EMAIL PROTECTED]> wrote:

> On 8/23/07, mat <[EMAIL PROTECTED]> wrote:
> > I wonder what is the usage of getMessageTypes in MessageEncoder?
>
> I think it's of no use actually.  Just specifying the type when
> registering an encoder will be more flexible, like we did for
> DemuxingIoHandler.  This issue will be taken care of here:
>
> https://issues.apache.org/jira/browse/DIRMINA-439
>
> Trustin
> --
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
> PGP Key ID: 0x0255ECA6
>

Reply via email to