directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trustin Lee <>
Subject Re: [mina] Filter management (was Spring Integration)
Date Thu, 10 Nov 2005 13:18:29 GMT

2005/11/10, Jose Alberto Fernandez <>:
> This sound quite distressing, are you saying that almost every piece of
> MINA code on has needs to be rewritten if/when one wants to move to 0.9?

You can migrate easily. It is almost a mechanical process.

1) Replace ProtocolHandler with IoHandler
2) ProtocolProvider is not required anymore.
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(

3) Other trivial changes which can be simply fixed by IDE QuickFix feature

What do we gain with this? Less enforcing of typing? Or are you saying
> that a IoHandlers may not be processing buffers?

IoHandlers can process ByteBuffers unless you didn't insert a
ProtocolCodecFilter. That's all. But you'll have to cast Object to

Well I hope we still have ProtocolProviders as we need to specify codecs
> somewhere? Or have they got rid of that too? How about separate filter
> chains at the IO and Protocol levels they are needed for very different
> purposes.

ProtocolProvider is not required anymore. It is enough with
ProtocolCodecFactory implementation. You can simply insert
ProtocolCodecFilter as I specified above.

Hope someone is writing a guide on how to move from 0.8 to 0.9 if the
> changes are this dramatic.

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.

Finally, what will happen if I call addBefore("thisFilter", myFilter).
> How can I be able to do that if no copy is made? Or have they got rid of
> all those methods also?

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.

what we call human nature is actually human habit

View raw message