On Monday 02 August 2004 09:06, Niclas Hedhman wrote: > On Monday 02 August 2004 14:15, Alexis Agahi wrote: > > Real good point, but do you think interface implementation is required? > > Well, the I can't see any reason why not to use interfaces for > Interceptors. That keeps things a lot more understandable and organized, > IMO. > > > I like your approach, simple and nice. > > I continue thinking on that track > > If you go to > runtime/activation/impl/src/java/org/apache/avalon/activation/impl/ > > and check out the classes DefaultAppliance and ApplianceInvocationHandler.
That is exacly where I was looking at this afternoon. > DefaultAppliance is the class that 'manages' the component in runtime, and > if proxies are enabled, it wraps the component with the > ApplianceInvocationHandler. > > Interceptor support is needed to be added within/around these classes. > > The following steps would be required for Explicit Interception; > > 1. Define the @avalon.interceptor tag, and add support for it in Meta. Any guideline for this part? > 2. Add Interception support in Composition, so it can be retrieved from the > Model. Probably by adding a InterceptionModel, which carries the info > needed, and adding a method to the ComponentModel to retrieve it. > 3. Add a InterceptionInvocationHandler class in the above package. Not sure to understand these points, but I'm sure I will soon. I was thinking to have Interceptor implementation as component (kernel component) that could be looked up in ApplianceInvocationHandler before and after method invoke (assuming that @avalon.interceptor refer to a component type). Am I wrong? > 4. Change DefaultAppliance to check for if interception is enabled in the > component model, if so instantiate the InterceptionInvocationHandler > instead and accordingly. Ok > For Implicit interception, need to add support in Kernel and have that > propogate down to the model as well. That means that from the > DefaultAppliance PoV, it can't tell if the support is implicit or explicit. > One close parallel to it all is Life Cycle Stage extensions, and by looking > at how that is handled in many places, one can get through it all. I'll check that later. -- Al --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]