You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Emmanuel Lecharny <el...@gmail.com> on 2011/10/04 09:29:17 UTC
[MINA 3.0] Codec filter
Hi guys,
right now, Julien and I have experimented the MINA 3.0 branch writing a
Http codec and a Ldap codec. So far, so good, for basic scenario it
works well.
Now, I'd like to know if it would be a good idea to move the
ProtocolCodecFilter we have in MINA 2 to MINA 3? The rational would be
to just expose two interfaces for implementers :
- ProtocolEncoder
- ProtocolDecoder
otherwise, an implementer has to code the full Filter logic :
- messageReceived
- messageWriting
- sessionClosed
- sessionCreated
- sessionIdle
- sessionOpened
even if most of them are not necessary.
Just wondering...
Also it might be a good idea to define an AbstractFilter class that
implements the Filter methods, to avoid having to implement them
everytime we write a filter (for instance, sessionIdle() method is
unlikely to be handled in all the filters)
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com
Re: [MINA 3.0] Codec filter
Posted by Julien Vermillard <jv...@gmail.com>.
On Tue, Oct 4, 2011 at 9:29 AM, Emmanuel Lecharny <el...@gmail.com> wrote:
> Hi guys,
>
> right now, Julien and I have experimented the MINA 3.0 branch writing a Http
> codec and a Ldap codec. So far, so good, for basic scenario it works well.
>
good to hear :)
> Now, I'd like to know if it would be a good idea to move the
> ProtocolCodecFilter we have in MINA 2 to MINA 3? The rational would be to
> just expose two interfaces for implementers :
> - ProtocolEncoder
> - ProtocolDecoder
>
> otherwise, an implementer has to code the full Filter logic :
> - messageReceived
> - messageWriting
> - sessionClosed
> - sessionCreated
> - sessionIdle
> - sessionOpened
>
> even if most of them are not necessary.
Yes we need to provide some facilities from creating protocol codec
IoFilter is a bit too low level for that, I didn't thought too much
about it.
>
> Just wondering...
>
> Also it might be a good idea to define an AbstractFilter class that
> implements the Filter methods, to avoid having to implement them everytime
> we write a filter (for instance, sessionIdle() method is unlikely to be
> handled in all the filters)
It's already there :
http://svn.apache.org/repos/asf/mina/trunk/core/src/main/java/org/apache/mina/api/DefaultIoFilter.java
Julien