[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Question about cflowbelow

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


Sucker-punch spam with award-winning protection.
Try the free Yahoo! Mail Beta.