geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan D. Cabrera" <...@toolazydogs.com>
Subject RE: Proposal: Change the way interceptors are stacked
Date Mon, 24 Nov 2003 14:12:55 GMT
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
> 
> 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?
> 
> The current Interceptor implementation uses a Decorator approach,
where
> each
> Interceptor invokes itself the next one.
> 
> 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".
> 
> 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.
> 
> At the end of the day, for a stack of two Interceptors, iter1 and
iter2,
> the
> flow is:
> InterceptorChain -> iter1 -> InterceptorChain -> iter2 ->
InterceptorChain
> 
> 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.
> 
> Cheers,
> Gianny
> 
> _________________________________________________________________
> Trouvez l'âme soeur sur MSN Rencontres http://g.msn.fr/FR1000/9551


Mime
View raw message