Peter Donald wrote:
> 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).
Ummmm, ... just thinking out load
class ECMInterceptor implements Interceptor
{
....
}
class PooInterceptor implements Interceptor
{
....
}
Steve.
>
>
> 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:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
--
Stephen J. McConnell
OSM SARL
digital products for a global economy
mailto:[EMAIL PROTECTED]
http://www.osm.net
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>