directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <>
Subject RE: [mina] Filter management (was Spring Integration)
Date Thu, 10 Nov 2005 15:41:27 GMT
Well, I hope you are right.



From: Trustin Lee [] 


2a) Instead, insert ProtocolCodecFilter with your codec factory in your
IoHandler.sessionCreated() method. For example:

public void sessionCreated( IoSession session ) throws Exception {
    session.getFilterChain().addFirst( "codec", new ProtocolCodecFilter(

This is one place, where the approach I mentioned would make a lot of
sense. You are running several protocols using several different
handlers. You really do not want to specify on every session the adding
of new CodecFilters, for example. You know all sessions will use the
same filters and if your filters are stateless, they should be using the
same one. It would make a lot of sense to be able to set this things
once during bind() and not need to do it on every session creation.

I think you can compare examples and find out what has been changed.
The change is trivial IMHO.  Please let me know if it is never trivial.
I'll write some migration guide.  But I can say most protocol doesn't
talk longer than 1 hr for migration.  


I think you guys need to provide a migration guide as part of the 0.9
stable delivery. I just went to the MINA site and there is no info about
all this changes (unless you go and look at the source code) if I where
a user of MINA and I see the announcement of 0.9 and go and download it
and then I learn I need to port all my code. I sure will be quite
disappointed that no one mentioned this in very large letters. It would
also be nice if there were some sort of utility classes that would allow
one to bridge between the old interfaces and the new ones. My be some
proxy classes classes and interfaces can be provided to simplify this.


Yes of course.  Actually I don't know what you exactly mean.  There's no
copy.  The IoFilterChain attached to IoSessionManager is shared, but
IoFilterChain attached to IoSession is not shared at all.  That's all. 

Good, that was my understanding too. I guess my suggestion was to make a
copy on the bind/connect which are fewer that the number of sessions
that will be opened. Clever programming here may allow for the copy only
to occur once a chain is modified which will make things much cheaper.


Jose Alberto


View raw message