Emmanuel Lecharny skrev:
Thomas Kistel wrote:
Hi,
the example of String Larson shows that he is using one
ProtocolCodecFilter.
Actually I'm asking for using multiple ProtocolCodecFilters or the
ability
to add several Encoders and Decoders to one ProtocolCodecFilter as
you can
do with DemuxingProtocolCodecFactory.
from the dev ML :
"So there will be no ability for using multiple ProtocolCodecFilters
in MINA
2.0 as Trustin Lee prefigured last year!?
Today I started to write an own implementation of a ProtocolCodecFilter
which can handle several Encoders and Decoders on a protocol-stack.
Basically it works now, so that wasn't too difficult. But I want to be
sure
that I haven't programmed around the framework. If not I can
contribute my
code. "
The thing is that the current ProtocolFilter messageReceived() method
does not pass the decoded message to the next filter immediatly, and
this is the reason why you can't inject more than one protocol decoder.
Thomas, if this is the reason why you cannot use multiple
ProtocolCodecFilters think it might help if you call flush() on the
ProtocolDecoderOutput from within your Decoders. Calling flush() will
immediately forward all messages written using
ProtocolDecoderOutput.write() to the next filter in your filter chain.
HTH
/Niklas