Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Finding nested method calls within the same class

Hi Aspect Gurus,

I am a noob so bear with me if this is kind of dumb....

I have an annotation @AppManaged which is used to signify classes that need
to have certain behavior woven in. One of the behavior is converting method
calls into concurrent GPars(a groovy parallel library) calls instead.

However I do not want to have nested method calls on the same class to be
advised.
So...
@AppManaged
class someclass
{
     public void method1(){
         method2(); // should not be advised
     }
     public void method2(){
     }
}

But if the method call is from on AppManaged class to another, then it is
supposed to be advises, hence something like
!cflowbelow(@within(AppManaged)) does not help.

@AppManaged
class Someotherclass
{
     private someclass s;

     public void method3(){
        s.method2();// Should be advised.
     }
}

Basically I am looking for a pointcut which will match only nested calls
within the same object and prevent them from being advised.

Any help would be highly appreciated.

Thanks and Regards,
Abraham Menacherry.
-- 
View this message in context: http://aspectj.2085585.n4.nabble.com/Finding-nested-method-calls-within-the-same-class-tp3246144p3246144.html
Sent from the AspectJ - users mailing list archive at Nabble.com.


Back to the top