-
1. Re: 'within' and 'set' and documentation page
nthx Sep 23, 2004 8:06 AM (in response to nthx)Sorry, it was to hurry.
My pointcut doesn't make sense at all. I can have "set(my.*->*)" without using "within".
I've tried to use it in another poincut together with "(set(...) OR call(...) OR execution(...)) AND within(my.package)". That's why.
Sorry, forget about that.
t. -
2. Re: 'within' and 'set' and documentation page
bill.burke Sep 23, 2004 9:21 AM (in response to nthx)execution and set/get do not make sense with within as their purpose
is to totally wrap EVERY invocation.
within and withcode only make sense with call. I guess a callfield is necessary. I'll add that to the TODO.
Bill -
3. Re: 'within' and 'set' and documentation page
nthx May 12, 2005 5:47 PM (in response to nthx)"bill.burke@jboss.com" wrote:
execution and set/get do not make sense with within as their purpose
is to totally wrap EVERY invocation.
within and withcode only make sense with call. I guess a callfield is necessary. I'll add that to the TODO.
Bill
Hi there!
I came to that problem tonight again..
Actually, it does make sense. One can has
"execution(* class->method(..)) AND !within(ExcludedClass)" in AspectJ.
It makes sense. I'd like to intercept any execution of method "method", but not in the class "ExcludedClass". How would that be with JBAOP?
Tomasz Nazar -
4. Re: 'within' and 'set' and documentation page
kabirkhan May 13, 2005 7:39 AM (in response to nthx)Hi Tomasz,
"within" only works with call, i.e "instrument the caller of xxx only if we are making the call from within yyy".
In the case of "normal"/execution of instumentation we do not care (or have any info about) who is calling the target. AspectJ's weaving works differently. To achieve what you want with JBoss AOP you wuld currently have to use cflow.
Cheers,
Kabir -
5. Re: 'within' and 'set' and documentation page
nthx May 13, 2005 8:20 AM (in response to nthx)Hi there!
Yes, as a workaround I've used cflow.
AspectJ weaves in different way, but the semantic stays the same.
Isn't there really any info about a method's class?
'within' takes class expression as an argument, right?
If you have access to a method, then you should also have access to the method's class. You weave the method itself, so you have access to the method's class. I don't know the details but it seems possible.
Comment..?
Tomasz Nazar
PS. I cannot use "call" because calls are made by Struts framework. Let's assume I log '* Action->execute(..)'.