Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] How to intercept proceed() in around() advice

Andy Clement, 29.08.2012 16:22:
> Isn't advising the proceed basically the same as advising the target 
> joinpoint again.

Yes, it is, and as such it is error-prone due to code duplication.
Furthermore, I have many pointcuts and they would all need a shadow
advice (or one collecting them all via "pc1 || pc2 || pc3 ...").
Whatever I do, I have to remember adding the second pointcut.

Back to my question: Do you think it might be possible to make proceed()
calls joinpoints in future AspectJ versions? The more intensive and
professional someone uses the language, the more likely it is that
intercepting other advice or joinpoints therein might be used. The funny
thing is that I can intercept advice execution in general or any
joinpoint inside an advice, but just not the most prominent place in any
around() advice: the proceed() call, just because it is not a joinpoint,
even though it is so important. I can even call proceed() multiple times
within an advice, but not capture it directly. It would be really
powerful to be able to do that. I thought before issuing a ticket on
Bugzilla I should ask here first so as to determine if there is any
chance to get such a joinpoint.

As you can see in the stackoverflow.com link [1] I posted in my original
question here, I have solved the problem in a rather ugly way via an
extended (parametrisable) version of Ramnivas Laddad's worker object
pattern. But actually this is not what I want because it feels really
inelegant.
--
Alexander Kriegisch


>> Bottom line: My wish is a pointcut "proceedexecution()" or
>> similar.
>> 
>> [1] http://stackoverflow.com/questions/12018585/how-to-intercept-proceed-in-another-aspectj-aspect
>> [2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=92889


Back to the top