Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 96707 invoked from network); 9 Nov 2005 20:42:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Nov 2005 20:42:28 -0000 Received: (qmail 16083 invoked by uid 500); 9 Nov 2005 20:42:28 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 15874 invoked by uid 500); 9 Nov 2005 20:42:27 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 15863 invoked by uid 99); 9 Nov 2005 20:42:26 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Nov 2005 12:42:26 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [217.70.33.37] (HELO lists.levonline.com) (217.70.33.37) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Nov 2005 12:42:19 -0800 Received: from localhost (lists.levonline.com [127.0.0.1]) by lists.levonline.com (Postfix) with ESMTP id 2C7A6D0222 for ; Wed, 9 Nov 2005 21:42:03 +0100 (CET) Received: from lists.levonline.com ([127.0.0.1]) by localhost (lists.levonline.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 04157-10 for ; Wed, 9 Nov 2005 21:41:59 +0100 (CET) Received: from ormen3.basenet.levonline.com (ormen3.levonline.com [217.70.32.123]) by lists.levonline.com (Postfix) with ESMTP id 50787D015F for ; Wed, 9 Nov 2005 21:37:42 +0100 (CET) Received: from [192.168.0.138] (1-1-2-45a.gan.gbg.bostream.se [82.182.102.93]) (authenticated bits=0) by ormen3.basenet.levonline.com (8.12.11/8.12.11) with ESMTP id jA9KbfPQ030140 for ; Wed, 9 Nov 2005 21:37:42 +0100 Message-ID: <43725E44.4080700@trillian.se> Date: Wed, 09 Nov 2005 21:38:28 +0100 From: Niklas Therning User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Apache Directory Developers List Subject: Re: [mina] Filter management (was Spring Integration) References: In-Reply-To: X-Enigmail-Version: 0.92.1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: By http://levonline.com - free virus scanning for all customers X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Jose Alberto Fernandez wrote: >I have some problems with this approach because it disassociates >filtering from the service, in particular when you think of Protocol >level implementations, where you may want to apply filters at the IO >level (like SSL) and at the Protocol Level. > > I might be mistaken but are you talking about Services and ServiceRegistry? ServiceRegistry would of course have a bind(Service s, IoFilterChain chain, Iohandler handler) method in addition to the current bind() method. BTW, In MINA 0.9.x there is no ProtocolProvider anymore. IoHandler serves the same purpose as ProtocolProvider used to do. (Someone, please correct me if I'm wrong.) >My suggestion would be to provide two additional interfaces: > >Public interface IoFilterManager { > > Public void configureFilters(IoFilterChain chain); > >} > >Public interface ProtocolFilterManager { > > Public void configureFilters(ProtocolFilterChain chain); > >} > >An IoHandler or ProtocolProvider that implements the IoFilterManager >interface will be called during the binding/connecting process to give >it a chance to make changes to the IoFilterChain to be used when >processing IO by the IoAcceptor/IoConnector. > >By the same token, a ProtocolProvider that implements the >ProtocolFilterManager interface will be called during binding/connecting >process to make changes to the ProtocolFilterChain to be used at the >ProtocolLevel. > >The advantages of this approach are: > >1) You modify the filter chain only once, and not each time a connection >is created. > > Providing an IoFilterChain at bind time is a one time operation as well. Probably done at configuration time. It would be very unwise to modify this filter chain at runtime since all sessions which connected on the bound port use the same filter chain. Each session still of course have their private chain. >2) You have full control over the chain and can do any modifications one >may need. > > You still have the same problem: there is a 1:1 relationship between an IoAcceptor and the IoFilterChain. All sessions created from the same IoAcceptor will share this chain. If you modify it (in an IoFilterManager as you suggest) when you call bind() on ServiceRegistry all other Services sharing that TransportType will have their chains modified since they are in fact using the same chain. >3) It is backward compatible, as it is completely optional. > > We would still provide the old bind() methods both in IoAcceptor and ServiceRegistry so backwards compatibility would not be an issue. >What do you think? Would this fit in the spirit of MINA? > > > I think I wasn't clear enough on what the problem is. I would like to get rid of the 1:1 mapping between an IoAcceptor and its IoFilterChain. What I was proposing was to have an additional filter chain associated with the SocketAddress the Acceptor is listening on. How we configure that (my approach using new bind()-method or yours using the IoFilterManager interface) is secondary at the moment. The first priority is to change the IoAcceptor implementations and the way they handle IoFilterChains so that they can support this, then decide how to configure it. /Niklas