[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [aspectj-users] How to exclude nested matching method executions?
- From: Andy Clement <andrew.clement@xxxxxxxxx>
- Date: Thu, 8 Dec 2011 08:19:58 -0800
- Delivered-to: email@example.com
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=jraUhg6iTOgo30bMpw7p/oYC18urBNNsMdqYhiI8AFY=; b=xIegqWM4HxbmHtSCrVwM9BS4o3zS/bWBRsgXe8/3pXuXo23az6LrA+Nks1qiZWt6p/ kDzTGFQIdoT3Fvyfirw8PcwZD4qug1gXGiXA/uM5E1Km3inaTn52cJF3lmLt+OG0i/G3 vNmzfF4UpfohharyFGRtOEc0zdnTC3S5+OEhc=
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". (
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.
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
> 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