Return-Path: Delivered-To: apmail-jakarta-avalon-dev-archive@apache.org Received: (qmail 3077 invoked from network); 21 Jun 2002 04:32:15 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 21 Jun 2002 04:32:15 -0000 Received: (qmail 12907 invoked by uid 97); 21 Jun 2002 04:32:26 -0000 Delivered-To: qmlist-jakarta-archive-avalon-dev@jakarta.apache.org Received: (qmail 12870 invoked by uid 97); 21 Jun 2002 04:32:25 -0000 Mailing-List: contact avalon-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon Developers List" Reply-To: "Avalon Developers List" Delivered-To: mailing list avalon-dev@jakarta.apache.org Received: (qmail 12851 invoked by uid 98); 21 Jun 2002 04:32:24 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Message-Id: <5.1.0.14.2.20020621141200.00b4cf40@mail.optushome.com.au> X-Sender: xdonald@mail.optushome.com.au X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Fri, 21 Jun 2002 14:31:37 +1000 To: "Avalon Developers List" From: Peter Donald Subject: Re: [proposal] custom component lookup In-Reply-To: References: <5.1.0.14.2.20020621100501.01ad08e0@mail.optushome.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N At 08:54 PM 6/20/2002 -0700, you wrote: >Peter Donald wrote: >ok, I actually forgot to put in a sentence/disclaimer at the end >mentioning that it might possibly be more of an implementation thing than >a framework thing... ;) >but I also was wondering if there is any container extension mechanism >that is shared by the Avalon containers - or if there are plans for >anything like that? It would be neat to have a generic interceptor architecture. For a buisness-esque type layer you could have interceptor interface such as interface Interceptor { Object invoke( InterceptorContext ctx, Object[] args ) throws Exception; } interface InterceptorContext { ComponentMetaData getCaller(); ComponentMetaData getCallee(); DependencyMetaData getCalledInterface(); String getMethodSignature(); Object invokeNext( Object[] args ) throws Exception; } Possible impls... class MyAuthorizingInterceptor implements Interceptor { Object invoke( InterceptorContext ctx, Object[] args ) throws Exception { if( !isAuthorized( ctx.getCaller() ) ) throw SecurityException("..."); return ctx.invokeNext( args ); } } class MyTimingInterceptor implements Interceptor { Object invoke( InterceptorContext ctx, Object[] args ) throws Exception { final long key = startTimer(); try { return ctx.invokeNext( args ); } finally { final long time = endTimer( key ); reportTime( time ); } } } This would be particular useful to people who are using Avalon for Buisness level prgramming (in contrast to System-level programming). However I don't know of any plans to implement this unless you want to volunteer ;) Cheers, Peter Donald ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "Faced with the choice between changing one's mind, and proving that there is no need to do so - almost everyone gets busy on the proof." - John Kenneth Galbraith ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- To unsubscribe, e-mail: For additional commands, e-mail: