-
1. Re: Multiple pointcut expressions and advice bindings for sa
rkadayam Aug 2, 2004 3:23 PM (in response to rkadayam)Sorry, for some reason my xml lines got stripped off, the aop xml looks like
<pointcut name="Method1" expr="execution(* test.TestServiceBean->method1(java.lang.String))" /> <pointcut name="AllMethods" expr="execution(* test.TestServiceBean->*(..))" /> <bind pointcut="Method1"> <interceptor class="Interceptor1" /> </bind> <bind pointcut="AllMethods"> <stack name = "StackOne" /> </bind>
-
2. Re: Multiple pointcut expressions and advice bindings for sa
kabirkhan Aug 2, 2004 9:19 PM (in response to rkadayam)In my experience the bindings are applied "top-down", i.e. in your example Interceptor1 should be applied before StackOne. I'm not 100% sure if this is documented behaviour though
-
3. Re: Multiple pointcut expressions and advice bindings for sa
kabirkhan Aug 3, 2004 7:35 AM (in response to rkadayam)Taken a quick look at the code for the above, and the assumption above regarding ordering of interceptors seems safe.
Now, in response to your actual question :-) The global/specific stuff is fine. -
4. Re: Multiple pointcut expressions and advice bindings for sa
bill.burke Aug 5, 2004 7:08 PM (in response to rkadayam)You can hotdeploy a pointcut definition, but this does not cause bindings to be reapplied. Am I making sense? So, if you modify "AllMethods" at runtime and redeploy it, bindings will not be recalculated.
Currently, the code isn't smart enough to know if the binding references a "named" pointcut.
Does this screw up what you want to do?
Bill -
5. Re: Multiple pointcut expressions and advice bindings for sa
rkadayam Aug 6, 2004 2:25 PM (in response to rkadayam)Well, not sure if what I'm doing qualifies as hot-deploy or not, but I have a console that acts as an interface to dynamically at run-time attach and detach advices to the advice stacks. And in turn the advice stacks updates every AdviceBinding that it references internally.
My concern is more in terms of the order of the interception. I would prefer the interceptors/advices/stacks bound in the "all methods" pointcut intercept first and then the specific method pointcut bindings intercept next.
Is that correct? -
6. Re: Multiple pointcut expressions and advice bindings for sa
rkadayam Aug 6, 2004 2:57 PM (in response to rkadayam)So I just did a small experiment and it seems like in whatever order the advice bindings were created, that was the order in which the advices/interceptors were ordered.
Meaning if I attached the advice to SpecificMethod pointcut binding first and then AllMethods pointcut binding next. Then that would be the order of the interceptors.
Since they are two different "AdviceBindings" I thought the instrumented code would always look for the "AllMethods" advice bindings first and then the "SpecificMethod" advice bindings next.
any thoughts ?