On 8 May 2006, at 21:49, Niklas Therning wrote:

Frederic Soulier wrote:
Is there a way to bypass a decoder in the chain?
For example, I have Decoder1 and Decoder2 registered in my
DemuxingProtocolCodecFactory. My understanding is if I write to the
ProtocolDecoderOutput then it will be forwarded to the next decoder in
the chain, in that case Decoder2.

This is not how it works I'm afraid. :) What you write to the
ProtocolDecoderOutput will not be forwarded to the next decoder
registered with the same DemuxingProtocolCodecFactory. The decoded
message will be forwarded to the filter after your ProtocolCodecFilter
in the filter chain.

Thx Niklas. I was indeed quite wrong ;)
Ok so I can achieve what I think the Demuxing stuff was doing by having 2 ProtocolCodecFactory registered in the filter chain.

"codec1"
    ProtocolCodecFactory_1
       encoder1
       decoder1

"codec2"
    ProtocolCodecFactory_2
       encoder2
       decoder2

builder.addFirst("filter1", new ProtocolCodecFilter(codec1));
builder.addLast("filter2", new ProtocolCodecFilter(codec2));

In that case:
   decoder1 writes to ProtocolDecoderOutput -> decoder2
   encoder1 writes to ProtocolEncoderOutput -> encoder2
or is it symetrical?
   decoder1 writes to ProtocolDecoderOutput -> decoder2
   encoder2 writes to ProtocolEncoderOutput -> encoder1

Is that correct?

--
Frederic P. Soulier
OpenPGP key available on http://pgpkeys.mit.edu/
1024D/BA6700ED   49A6 8E8E 4230 8D41 1ADE  B649 3203 1DD2 BA67 00ED

Reply via email to