You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by mat <fo...@gmail.com> on 2007/07/01 15:47:52 UTC
Re: some trouble about DemuxingProtocolCodecFactory
http://www.nabble.com/Why-only-one-ProtocolCodecFilter-per-chain-tf3884603.html#a11012504
On 6/30/07, Messi Chan <ch...@gmail.com> wrote:
>
>
> Hi, all
>
> I have a doubt about DemuxingProtocolCodecFactory.
> I register two MessageEncoders one for class A, and the other for class B.
> When my server try to encode A first time, it work fine. But when it try
> to
> encode B next time, I got the exception(unexpected message types ....B).
> Is DemuxingProtocolCodecFactory just allowed register one MessageEncoder?
> I
> want someone's confirmation.
>
> thx a lot :D
> --
> View this message in context:
> http://www.nabble.com/some-trouble-about-DemuxingProtocolCodecFactory-tf4005109.html#a11374435
> Sent from the mina dev mailing list archive at Nabble.com.
>
>
Re: some trouble about DemuxingProtocolCodecFactory
Posted by Jeroen Brattinga <je...@gmail.com>.
And thank you! I had a similar problem ... which I solved with your
solution!
Jeroen Brattinga
Messi Chan wrote:
> Hi, Jeroen.
>
> You're right, I have solved the problem.
> I have a AbstractMessageEncoder is super class of A/B Encoder. I have
> defined static field named TYPES used by getMessageTypes() in the
> AbstractMessageEncoder. This is the crux of the problem. Removing it and
> it's work now.
> Thx all of you. :)
>
> ********code*********
> public class AbstractMessageEncoder {
>
> public static Set<Class> TYPES; // should be removed
>
> public Set<Class> getMessageTypes() {
> return TYPES;
> }
> }
>
Re: some trouble about DemuxingProtocolCodecFactory
Posted by Messi Chan <ch...@gmail.com>.
Hi, Jeroen.
You're right, I have solved the problem.
I have a AbstractMessageEncoder is super class of A/B Encoder. I have
defined getMessageTypes() in the AbstractMessageEncoder. This is the crux of
the problem. Removing it and it's work now.
Thx all of you. :)
--
View this message in context: http://www.nabble.com/some-trouble-about-DemuxingProtocolCodecFactory-tf4005109.html#a11388738
Sent from the mina dev mailing list archive at Nabble.com.
Re: some trouble about DemuxingProtocolCodecFactory
Posted by Messi Chan <ch...@gmail.com>.
Hi, Jeroen.
You're right, I have solved the problem.
I have a AbstractMessageEncoder is super class of A/B Encoder. I have
defined static field named TYPES used by getMessageTypes() in the
AbstractMessageEncoder. This is the crux of the problem. Removing it and
it's work now.
Thx all of you. :)
********code*********
public class AbstractMessageEncoder {
public static Set<Class> TYPES; // should be removed
public Set<Class> getMessageTypes() {
return TYPES;
}
}
--
View this message in context: http://www.nabble.com/some-trouble-about-DemuxingProtocolCodecFactory-tf4005109.html#a11388738
Sent from the mina dev mailing list archive at Nabble.com.
Re: some trouble about DemuxingProtocolCodecFactory
Posted by Jeroen Brattinga <je...@gmail.com>.
I don't see what the your link has to do with the
DemuxingProtocolCodecFactory. AFAIK the Demuxer can be used to encode
and decode message according to certain message classes.
So it should be perfectly possible to register two different
MessageEncoders.
If not, then what is the point of the Demuxer?
Jeroen Brattinga
mat wrote:
> http://www.nabble.com/Why-only-one-ProtocolCodecFilter-per-chain-tf3884603.html#a11012504
>
>
> On 6/30/07, Messi Chan <ch...@gmail.com> wrote:
>>
>>
>> Hi, all
>>
>> I have a doubt about DemuxingProtocolCodecFactory.
>> I register two MessageEncoders one for class A, and the other for
>> class B.
>> When my server try to encode A first time, it work fine. But when it try
>> to
>> encode B next time, I got the exception(unexpected message types ....B).
>> Is DemuxingProtocolCodecFactory just allowed register one
>> MessageEncoder?
>> I
>> want someone's confirmation.
>>
>> thx a lot :D
>> --
>> View this message in context:
>> http://www.nabble.com/some-trouble-about-DemuxingProtocolCodecFactory-tf4005109.html#a11374435
>>
>> Sent from the mina dev mailing list archive at Nabble.com.
>>
>>
>