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

You could try changing this line "!within(my.package.MyAspect)" in your
myPointCutA to  "!cflow(within(my.package.MyAspect))". If you do this I dont
think the other cflowbelow statement is useful anymore, so you can remove
that. And also if this doesn't work consider using adviceexecution keyword. 

If this is not the behaviour you require you could give some more details
about what's going on.


Kyle Lomeli-2 wrote:
> 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
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users

View this message in context: http://www.nabble.com/Question-about-cflowbelow-tf3281465.html#a9154475
Sent from the AspectJ - users mailing list archive at Nabble.com.