mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julien Vermillard <jvermill...@archean.fr>
Subject Re: Making ProtocolEncoder and ProtocolDecoder independent from IoSession
Date Fri, 17 Aug 2007 11:35:23 GMT
Hi,
It think the ProtocolDecoder implementer can encapsulate his logic
under some other class if it doesn't want to depend on MINA, but with
ByteBuffer, and all the point Maaarten added (like
ProtocolDecoderOutput) I think it won't be easly doable without
breaking the codec API and sacrifice some of it simplicity.

Julien

On Fri, 17 Aug 2007 11:03:07 +0200
"Maarten Bosteels" <mbosteels.dns@gmail.com> wrote:

> Trustin.
> 
> I like the idea, but I guess some people (like me) use the IoSession
> for logging the remote address.
> And I guess codec implementations will still depend on mina because of
> ProtocolDecoderOutput, right ?
> 
> About logging, I guess slf4j does not have something as log4j's NDC
> concept ?
> I have an IoFilter that pushes the remote address in the NDC before
> propagating the event and pops it afterwards.
> Very handy, because all logging events down the call stack will
> contain the remote address, without depending on mina's
> SessionLog.
> 
> I guess we cannot add this IoFilter to mina since it depends on
> log4j ? maybe I should write a wiki page about it ?
> 
> Maarten
> 
> On 8/17/07, Trustin Lee <trustin@gmail.com> wrote:
> >
> > Hi all,
> >
> > Currently, ProtocolEncoder and ProtocolDecoder uses IoSession
> > user-defined attributes to store their state information.
> >
> > If what ProtocolEncoder and ProtocolDecoder do with IoSession is
> > just to access user defined attributes, we could simply remove the
> > coupling with IoSession and replace it with java.util.Map (or
> > ConcurrentMap). By doing this, we can make our codecs reusable
> > across various applications, even that don't use MINA as a network
> > layer.
> >
> > Please let me know if there's a use case that you access other
> > properties or operations of IoSession in your codec implementation
> > and why it's mandatory.
> >
> > Thanks in advance,
> > Trustin
> > --
> > what we call human nature is actually human habit
> > --
> > http://gleamynode.net/
> > --
> > PGP Key ID: 0x0255ECA6
> >

Mime
View raw message