I have run into a problem where one of the helper classes invoked by one of my 
advices triggers a joinpoint which causes an infinite loop to occur. I would 
like to prevent this from happening by modifying my initial poincut to not 
match any subsequent pointcuts that get triggered as a result. Effectively I 
would like to have a join point that says, "turn off any other joinpoints until 
after the current advice has finished executing". 

From what I have been reading, cflowbelow serves this very purpose. However I 
have had no luck. This is generally what my aspect looks like:

public aspect MyAspect {

   pointcut myPointCutA() : within( my.package..*) &&  
                                          execution(* 
my.package..*.someMethod*(..)) &&
                                          !within(my.package.MyAspect);

   pointcut subsequentPointCutAs() : cflowbelow( myPointCutA() );

   Object around() : myPointCutA() && !subsequentPointCutAs() {
      // calls to other classes which call other classes which may trigger 
pointcut again
   }
}

From my tests, I see that the subsequent poincuts are still being triggered. 
Have I completely misunderstood how cflowbelow functions? If cflowbelow is not 
meant to be used this way, what approach would you recommend I use?

Thanks!

-Kyle




 
____________________________________________________________________________________
Bored stiff? Loosen up... 
Download and play hundreds of games for free on Yahoo! Games.
http://games.yahoo.com/games/front
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to