Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 42490 invoked from network); 17 Nov 2005 12:42:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Nov 2005 12:42:24 -0000 Received: (qmail 17772 invoked by uid 500); 17 Nov 2005 12:42:18 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 17703 invoked by uid 500); 17 Nov 2005 12:42:18 -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 17674 invoked by uid 99); 17 Nov 2005 12:42:18 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Nov 2005 04:42:18 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of trustin@gmail.com designates 64.233.184.195 as permitted sender) Received: from [64.233.184.195] (HELO wproxy.gmail.com) (64.233.184.195) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Nov 2005 04:43:52 -0800 Received: by wproxy.gmail.com with SMTP id i28so383948wra for ; Thu, 17 Nov 2005 04:41:56 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=Hvkd/Bp1Sj1/Z2jY21+i6zmpiVdJiRIbvsSH54IJsChS5oiemDFU6aLIcYsJrCpa9sx4isC2glcsZSDbfHH2eC7IsA0uwKi6w1aNGxYLbES1ErrdHo10yT8PSmb0OXHJlpczOIADOn0dbRcZ0H8EGZN+lOiFaoQ3PE6XkdQCkfU= Received: by 10.54.67.12 with SMTP id p12mr6335963wra; Thu, 17 Nov 2005 04:41:56 -0800 (PST) Received: by 10.54.127.2 with HTTP; Thu, 17 Nov 2005 04:41:56 -0800 (PST) Message-ID: <768dcb2e0511170441g3173c724h@mail.gmail.com> Date: Thu, 17 Nov 2005 21:41:56 +0900 From: Trustin Lee To: Apache Directory Developers List Subject: Re: [jira] Commented: (DIRMINA-121) Per-port filter chain In-Reply-To: <437C7659.7000500@trillian.se> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_32661_28529048.1132231316726" References: <75CFC296F70A08409390004F30EF9B8506968416@uk-ex001.groupinfra.com> <437C7659.7000500@trillian.se> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_32661_28529048.1132231316726 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 2005/11/17, Niklas Therning : > > Another thing just struck me. The NextFilter given to the filter in > IoFilter.init() is (as far as I can see) useless to the filter. There's > no use for a NextFilter unless you have an IoSession. You can't fire an > asynchronous event on the NextFilter instance specified in init() unless > you have a session as well. And whenever an IoFilter is given to an > IoSession (messageReceived, sessionOpened, etc) a NextFilter is also > provided. > > IoFilter.init() should either be changed into > > void init( IoFilterChain parent, NextFilter nextFilter, IoSession > session ) throws Exception; > > or > > void init( IoFilterChain parent ) throws Exception; Actually, there is IoFilterChain.getParent() so you can get IoSession. :) But I love the first option because it makes a user to implement his or her init / destroy() method. The first option would mean that you can't call init() on a filter until > it is actually in use for a particular session which means that the > chain can not be constructed until a session has been created. Second > option means you can't get hold of a NextFilter for asynchronous events > until another event has been generated on a particular session in the > usual way. > > Does anyone else see this is or am I just being stupid? :) Is anyone > using the NextFilter provided in init() and can prove me wrong? SSLFilter start SSL handshake as soon as it is added to the chain, so it requires NextFilter. Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ ------=_Part_32661_28529048.1132231316726 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
2005/11/17, Niklas Therning <niklas@trillian.se>:
Another thing just struck me. The NextFilter given to the filter in
IoFi= lter.init() is (as far as I can see) useless to the filter. There's
no u= se for a NextFilter unless you have an IoSession.  You can't fire= an
asynchronous event on the NextFilter instance specified in init() unlessyou have a session as well. And whenever an IoFilter is given to an
IoS= ession (messageReceived, sessionOpened, etc) a NextFilter is also
provid= ed.

IoFilter.init() should either be changed into

void init( IoF= ilterChain parent, NextFilter nextFilter, IoSession
session ) throws Exc= eption;

or

void init( IoFilterChain parent ) throws Exception= ;

Actually, there is IoFilterChain.getParent() so you c= an get IoSession. :)

But I love the first option because it makes a = user to implement his or her init / destroy() method.

The first option would mean that you can't call init() on a filter untilit is actually in use for a particular session which means that the
cha= in can not be constructed until a session has been created. Second
optio= n means you can't get hold of a NextFilter for asynchronous events
until another event has been generated on a particular session in theusual way.

Does anyone else see this is or am I just being stupid?= :) Is anyone
using the NextFilter provided in init() and can prove me w= rong?

SSLFilter start SSL handshake as soon as it is added = to the chain, so it requires NextFilter.

Trustin
-- <= br>what we call human nature is actually human habit
--
http://gleamynode.net/ ------=_Part_32661_28529048.1132231316726--