On Dec 11, 2007 10:59 PM, mat <[EMAIL PROTECTED]> wrote: > 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?
In MINA 2.0, you have to specify the type of the message that the MessageEncoder will encode explicily as a parameter. Therefore, MessageEncoder.getMessageTypes() has been removed from MessageEncoder interface. HTH, Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP Key ID: 0x0255ECA6
