Return-Path: Delivered-To: apmail-incubator-geronimo-dev-archive@www.apache.org Received: (qmail 56175 invoked from network); 24 Nov 2003 14:12:22 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 24 Nov 2003 14:12:22 -0000 Received: (qmail 85163 invoked by uid 500); 24 Nov 2003 14:12:09 -0000 Delivered-To: apmail-incubator-geronimo-dev-archive@incubator.apache.org Received: (qmail 85105 invoked by uid 500); 24 Nov 2003 14:12:09 -0000 Mailing-List: contact geronimo-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: geronimo-dev@incubator.apache.org Delivered-To: mailing list geronimo-dev@incubator.apache.org Received: (qmail 85092 invoked from network); 24 Nov 2003 14:12:08 -0000 Received: from unknown (HELO alan.toolazydogs.com) (166.84.147.110) by daedalus.apache.org with SMTP; 24 Nov 2003 14:12:08 -0000 Subject: RE: Proposal: Change the way interceptors are stacked Date: Mon, 24 Nov 2003 09:12:55 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Class: urn:content-classes:message X-MimeOLE: Produced By Microsoft Exchange V6.0.4417.0 Thread-Topic: Proposal: Change the way interceptors are stacked Thread-Index: AcOyduqI9upcRN19QmKs9KFk3pFTowAHYFZw From: "Alan D. Cabrera" To: X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Sounds interesting but kinda slow. Do I have to go through all those iterators to get my call done? Regards, Alan > -----Original Message----- > From: gianny DAMOUR [mailto:gianny_damour@hotmail.com] > Sent: Monday, November 24, 2003 5:36 AM > To: geronimo-dev@incubator.apache.org > Subject: Re: Proposal: Change the way interceptors are stacked >=20 > Jeremy Boynes wrote: > >Currently the interceptor stack is built from the front backwards using > the > >addInterceptor method on the container. > > > >I would like to propose we change to build the stack in the opposite > order, > >from the back forward. > Is it possible to have a bi-directional implementation? >=20 > The current Interceptor implementation uses a Decorator approach, where > each > Interceptor invokes itself the next one. >=20 > Another strategy is the one defined by the servlet specifications 2.3: the > general idea is to add two new components, namely an "Interceptor Manager" > and an "Ordered list of Interceptors". >=20 > In such an implementation the "Interceptor Manager", InterceptorManager, > manages the "Ordered list of Interceptors", InterceptorChain, and each > Interceptor invokes InterceptorChain instead of invoking directly the next > Interceptor. >=20 > At the end of the day, for a stack of two Interceptors, iter1 and iter2, > the > flow is: > InterceptorChain -> iter1 -> InterceptorChain -> iter2 -> InterceptorChain >=20 > I think that such an implementation is sometime more powerful: it allows > to > have rather simply the number of Interceptors, to add/remove at any given > position an Interceptor. For instance, to add a new Interceptor right in > the > middle of two other ones, one could request to InterceptorManager to > insert > a "Latch Interceptor" as the head of the InterceptorChain. This "Latch > Interceptor" simply blocks the incoming invocations the time required to > insert the new Interceptor. When this is done, InterceptorManager removes > the "Latch Interceptor" and releases the latch. >=20 > Cheers, > Gianny >=20 > _________________________________________________________________ > Trouvez l'=E2me soeur sur MSN Rencontres http://g.msn.fr/FR1000/9551