[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-users] pointcut for super.*(..)
|
There is no open enhancement request (from the quick search I just did) - feel free to add one but it will need backing up with a few good use cases before I go further with it. Introducing a new join point is the most serious of serious things.
Andy.
2009/3/25 Simone Gianni
<simoneg@xxxxxxxxxx>
Hi Andy,
I would see sucha pointcut useful in an _expression_ like (call(* ThatClass.thatMethod(..)) && !supercall()) or (execution(* ThatClass.thatMethod(..)) && !cflow(supercall())) or something similar, cause for many concerns I want to apply something when a particular method is called "from outside" the hierarchy, and not at every possible super invocation which is an implementation POV.
I managed to catch all calls to the "target" bean and not calls to super classes once, using a combination of this, target and an if pointuct saying something like "if(!target.getClass().isAssignableFrom(this.getClass()))", pretty sure it can be done using static join point informations to save a bit of ram. It worked, but was a runtime check, and also a reflective one, so a bit expensive.
My 2 cents.
Simone
Andy Clement wrote:
I'm afraid super calls are not join points. Apply some advice against 'within(B)' and you won't see it recognizing any join point for the super call - so you can't write a pointcut for it.
The reason is partly historical I believe (from days when we were a source pre-processor) - unfortunately addressing it (and looking to introduce them) has never become a high priority issue...
Andy.
2009/3/25 Alejandro Garcia <garciaal@xxxxxxxxxxx <mailto:garciaal@xxxxxxxxxxx>>
Hello,
I need to capture a super method call, any idea how or if it is
possible?
Example:
class A { void a(){} }
class B extends A {void a(){super.a();}}
Thank you for any help,
*Alejandro Garcia*
/Email: garciaal@xxxxxxxxxxx <mailto:garciaal@xxxxxxxxxxx>/
<http://atelier.inf.unisi.ch/%7Egarciaal>/
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx <mailto:aspectj-users@xxxxxxxxxxx>
------------------------------------------------------------------------
--
Simone Gianni CEO Semeru s.r.l. Apache Committer
http://www.simonegianni.it/