execution(void AImpl.x()) will only match methods named x that are
defined on the AImpl type, not on inherited methods from supertypes.
------------Original Message------------
From: "Mike Pettypiece" <Mike.Pettypiece@xxxxxxxxxxxxxxx>
To: <aspectj-users@xxxxxxxxxxx>
Date: Thu, Nov-27-2003 11:13 AM
Subject: [aspectj-users] Weaving advice around methods defined by
declare parents
I'm wondering if something like the following
is possible:
public aspect AspectA
{
declare parents: AImpl implements A; // A
has one method, void x();
// Implement A
public void A.x() { System.out.println( "x()" );
}
pointcut myPC() :
execution( void AImpl.x() );
Object around() : myPC()
{
System.out.println(
"Before x()" );
Object result =
proceed();
System.out.println(
"After x()");
return
result;
}
}
This is a simplified example of what I'm
trying to do but it illustrates my problem. What I would like to do
is implement an interface using an aspect and then add advice around those
methods that were implemented. However AspectJ doesn't seem to be
able to add advice in this fashion.
Any ideas how I can accomplish this?
Cheers,
Mike