Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-dev] Selective method calls and returns

Oleg, 

I'm curious why you want to capture calls from methods but not from
adviceexecutions? Do you have inter-type declarations? Are calls from those
valid in your definition.

To pick out public calls that aren't in the control flow of adviceexecution
of other aspects you'd want 
call(public * *(..)) && !cflow(adviceexecution() && !within(CurrentAspect))

By the way, this type of AspectJ usage questions should be posted to
aspectj-users.

-----Original Message-----
From: aspectj-dev-bounces@xxxxxxxxxxx
[mailto:aspectj-dev-bounces@xxxxxxxxxxx] On Behalf Of Oleg Lebedev
Sent: Friday, May 13, 2005 9:18 AM
To: AspectJ developer discussions
Subject: RE: [aspectj-dev] Selective method calls and returns


Is there a way to ignore all advice executions except for the ones
within the current aspect.

I have some external aspects calling public methods on my target class.
These method calls are picked up by my pointcut, which I don't want. I
just want to pick out only those public method calls, which are not
invoked by other aspects.

Something like:

!cflow(adviceexecution()) && within(CurrentAspect)

Thanks.

Oleg

-----Original Message-----
From: aspectj-dev-bounces@xxxxxxxxxxx
[mailto:aspectj-dev-bounces@xxxxxxxxxxx] On Behalf Of Matthew Webster
Sent: Friday, May 13, 2005 1:45 AM
To: AspectJ developer discussions
Subject: Re: [aspectj-dev] Selective method calls and returns






Oleg,

Try:

      after () returning : allPublic() && !cflowbelow(allPublic()) {}

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
http://w3.hursley.ibm.com/~websterm/

"Oleg Lebedev" <oleglebedev@xxxxxxxxxxxxx>@eclipse.org on 13/05/2005
00:00:41

Please respond to AspectJ developer discussions
<aspectj-dev@xxxxxxxxxxx>

Sent by:    aspectj-dev-bounces@xxxxxxxxxxx


To:    "AspectJ developer discussions" <aspectj-dev@xxxxxxxxxxx>
cc:
Subject:    [aspectj-dev] Selective method calls and returns


Greetings.

I am wondering if you could help me with the following interesting
problem.

I need to track executions of all public methods in a given class. Some
of the public methods call other public methods, but only the top ones
should be tracked when called. So, if methods A and B are public and A
calls B internally, then when A is called only A execution should be
tracked and B execution should not be tracked. However, if B is directly
called by some external class, then it should be tracked as well.

Suppose allPublic() pointcut describes all public method executions in
the class, then the following advice will do what I want:

before () : allPublic() && !cflowbelow(allPublic()) {}

Here is the tricky part. I also need to track when methods picked up by
this advice return. So, in the case above, if method A is called, and
then internally calls method B, I only want to know when method A
returns, and ignore the return of method B. However, if method B is
called by some external class (and therefore is picked up by the advice
above), then I need to know when B returns as well.

Any ideas?

Thanks.

Oleg
_______________________________________________
aspectj-dev mailing list
aspectj-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-dev


_______________________________________________
aspectj-dev mailing list
aspectj-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-dev

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
If you have questions about this email, please
contact the IT Help Desk.

Mail

_______________________________________________
aspectj-dev mailing list
aspectj-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-dev




Back to the top