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 13:41:33 GMT
Jose Alberto Fernandez wrote:

>>From: Irving, Dave [mailto:dave.irving@logicacmg.com]
>>
>>It kind of boils down to a few points:
>>
>>1) We want to chain "sequences" of filters (a filter chain) together
>>    
>>
>
>Ok, why is it that we want to do this? What is it that we are trying to
>solve?
>  
>
Since I was the one who initially started the conversion about 
port-specific chains let me explain what it is I want to do.

I have a POP3Handler which implements a POP3 server. I want to configure 
this using Spring. Thanks to the Spring integration code which now is in 
Mina I can do that.

Then we wanted to support SSL connections. Ideally the same POP3Handler 
could be used and depending on the port an SSLFilter will be applied or 
not. Since I'm still using Spring it would be very nice if I could 
configure this without having to add any additional code to POP3Handler. 
This isn't possible today since there are no port-specific filter chains 
in Mina at the moment.

My current workaround involves code in POP3Handler which checks the 
local address of a new connection in sessionCreated and if it is 995 
(the POP3S port) an SSLFilter instance will be added to the session's 
filter chain. I would like to do this in my Spring context XML file 
without my POP3Handler having to know about it. It will reduce 
complexity and POP3Handler could concentrate on what it is supposed to 
do without having to worry about configuration. The workaround kind of 
defeats one of the motivations behind using the DI-pattern in the first 
place.

/Niklas


Mime
View raw message