[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
Re: [aspectj-users] Pointcut on interface rather than on class
|
- From: "Eric Bodden" <eric.bodden@xxxxxxxxxxxxxx>
- Date: Mon, 10 Dec 2007 10:37:48 -0500
- Delivered-to: aspectj-users@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=NyBXP1RL1hGxm3UpngaaF+lcoGmGLeGfZuoEomWZ79A=; b=H0IZT0QYFAHbe/4ci8QWm7AqOlBCZDUJ36Stx51BT9+FxxnEJ5sg1t+fTHcBTDGv4EIbbTDbsjnmGmoRb7Bw/vLjkdxs69QJfBZrhrREX3RnIMuMsB5eEkOBRwNL8fOdgmbosp3vksd71LeZZShPpwv0AKn7hDLbD29/yz9LDzY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=damJwRtdQ/dIZVY8uZjlgcVcEqEKcy08URbxqcQr5/AC+YKSJuLUUKRk8fl6XA93IdiZnUjTxGgju0YkGyscZT6tQ5lWRkNeKUBFel3DclZ3zzCTmIzJ29OL6Y1TrFCREcD4SJcnAdpJTZUguXIy27s7kCndgf0kRLiTWEeY5dw=
Hi.
In InternalOrder.update(..) do you call super.update(..) ? I think
that's what's triggering the repeated advice invocation. Note that the
execution shadow is woven inside *each* class that implements
AuthOrder.
A work-around in that case would be to use "&& !cflow(execution(*
AuthOrder.update(..)))".
Eric
On 10/12/2007, Sylvain RICHET <srichet@xxxxxxxxxxxx> wrote:
> Hi,
>
> My object hierarchy is :
>
> Order (Interface, with a method "update(...)")
> AuthOrder (class, implements "Order")
> AuthOrderWithPWPolicy (class, extends "AuthOrder")
> InternalOrder (class, extends "AuthOrderWithPWPolicy")
>
>
> In one of my Aspects, I have defined a pointcut like this :
>
> [...]
> pointcut updateOrderHook(Map<String,String[]> params) :
> execution(* AuthOrder.update(..)) && args(params);
> [...]
>
>
>
> In this case, when method "update()" is invoked on InternalOrder object,
> /*then the "code advice", attached to pointcut, is invoked 3 times !!!*/
>
>
> BUT, if i change my poincut like this :
> [...]
> pointcut updateOrderHook(Map<String,String[]> params) :
> execution(* InternalOrder.update(..)) && args(params);
> [...]
>
> (Here, the pointcut is settled on final (leaf) object ....)
>
> ... then the "code advice" is invoked one time only.
> (this is what i want)
>
>
> So, my question is : how to deal with this ?
> Is there any way to control more precisely the pointcuts on interfaces ?
>
> Thanks in advance
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
--
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada