mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter royal <pro...@apache.org>
Subject Re: Stupid Question about Filters / ChainedIoHandler
Date Tue, 04 Jul 2006 21:13:44 GMT
On Jul 3, 2006, at 12:19 PM, Paul Mallach wrote:
> I'm currently porting an application from MINA 0.8.4 to the current  
> version
> and have got a small question about filters:
>
> I want to queue multiple filters, so that each filter handles a  
> different part
> of the encoding/decoding process. I don't want to pass ByteBuffers  
> between
> these filters, but my own Message-Objects, i.e.:
>
> MyHandler	(only deal with my custom messages)
>
> ^	v			Custom messages
>
> MyFilter		(decodes Strings into my custom messages,
> 			encodes my custom messages into Strings)
>
> ^	v			Strings
>
> TextLineDecoder/TextLineEncode	(ByteBuffer <=> String)
>
> ^	v
>
> More MINA
>
> But this doesn't seem to be possible, as ProtocolDecoder and  
> ProtocolEncoder
> receive ByteBuffers in their decode/encode methods and not Objects.

Its totally possible. The ProtocolEncoder / ProtocolDecoder are part  
of the ProtocolCodecFilter, which you don't have listed in your  
example chain above. You should be fine.

> I think I should use the new ChainedIoHandler instead of stacking  
> multiple
> Filters. Is thtat true? Are there any examples for the recommended  
> way to do
> this?

I'd recommend using IoFilter's

-pete


-- 
proyal@apache.org - http://fotap.org/~osi




Mime
View raw message