Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] How to exclude nested matching method executions?

Hi,

I'm afraid again that I can't see any of the code in your messages.

However, you might want to look at cflow() for achieving your
intention, as that allows you to make decisions about the control flow
"match this but not if we are in the control flow of that". (
http://www.eclipse.org/aspectj/doc/released/progguide/semantics-pointcuts.html
).

There is a slight performance cost because markers are left in the
code so that the advised location can recognize whether or not it is
in the cflow at runtime, but they are optimized.

cheers,
Andy

On 8 December 2011 01:37, Mark <mark.kharitonov@xxxxxxxxx> wrote:
> I have this abstract logging aspect, which instruments *before*, *after
> returning* and *after throwing* of certain methods. In addition, there are
> two concrete derived aspects, each specifying the set of methods to be
> logged. The methods affected by one aspect can be invoked from the methods
> affected by the other aspect. Which is fine for *before* and *after
> returning*, but problematic for *after throwing*, which should log the
> exception only for the lowest method in the call stack.
>
> Here is the abstract aspect declaration:
>
>
> Here is the first derived concrete aspect:
>
>
> And here is the second derived concrete aspect:
>
>
> My question is how to make the *after throwing* advice ignored for a method
> A, if it is invoked from a method B, which is also instrumented? The point
> of all of this is to have a single exception dump in the log.
>
> I must add that I have read the example in the Programming Guide
> (http://www.eclipse.org/aspectj/doc/released/progguide/starting-production.html),
> but I am failing to reproduce this behavior with my aspects.
>
> Thank you very much.
>
> --
> View this message in context: http://aspectj.2085585.n4.nabble.com/How-to-exclude-nested-matching-method-executions-tp4172075p4172075.html
> Sent from the AspectJ - users mailing list archive at Nabble.com.
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top