directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niklas Therning <nik...@trillian.se>
Subject Re: [mina] Refactoring MINA IoFilterChain (Was: IoFilters: DIRMINA-121 / 122)
Date Tue, 15 Nov 2005 15:21:16 GMT
Jose Alberto Fernandez wrote:

>>From: Irving, Dave [mailto:dave.irving@logicacmg.com]
>>
>>
>>As per Niklas' email, we'll need to support a combined sessionManager
>>chain, port chain and connection chain.
>>Is there a clean way to do this that I've missed? Im certainly not
>>interested in doing work for works sake :o)
>>
>>    
>>
>
>My understanding of Niklas e-mail was that his main reason WAS spring.
>  
>
The reason why I started to think about it was that I wanted to be able 
to configure port-specific chains and still separate configuration from 
use. This is what dependency injection (not only Spring) is all about. I 
could as you pointed out have AbstractIoAcceptorFactoryBean make this 
happen. But it would be more or less a hack, something I could live with 
as a temporary solution but not in the long run.

>  
>
>>I think the refactoring we are talking about is not related to spring
>>configuration per-se. In all cases, the three layers of chains will be
>>available to be populated by a builder or whatever. The problem we are
>>solving, as far as I can tell, is how to have re-usable chains of
>>filters (sessionManager, port, session) cleanly and efficiently (i.e,
>>not having to clone).
>>
>>    
>>
>
>As long as you have addBefore/addAfter (which exist on 0.8, not sure
>about 0.9) you will have to clone, as the filter chain is mutable. The
>best you can do is to implement lazy copy. I do not see a real way out
>of it.
>
>  
>
Let's see what Dave comes up with, ok?

>>Niklas wants to specify re-usable port chains, and presumably its
>>helpful to be able to specify re-usable session manager level chains
>>(acceptor / connector). The problem to solve is how to cleanly hook
>>these chains together.
>>It seems that the proposed refactoring is quite a simple and
>>    
>>
>transparent
>  
>
>>way of doing this - but if I've missed an existing easy and clean way
>>    
>>
>to
>  
>
>>do this - please let me know - as I don't want to head down the wrong
>>path!
>>    
>>
>
>So what happens when I call IoFilterChain.addFirst() on
>sessionCreated(). As I said the best you can do is lazy copy.
>  
>
The chain you will have the opportunity to modify in sessionCreated will 
still be the session private chain. Just like it always has been. Chains 
won't be copied and you won't be able to change the port-specific or 
sessionmanager-specific chain by calling 
session.getFilterChain().addFirst() or whatever.

Bottom line: From a user perspective nothing will change. There will be 
the extra opportunity to add a port-specific filter chain when you bind 
an IoHandler to a port. Nothing more nothing less.

/Niklas


Mime
View raw message