[jboss-dev-forums] [Design of AOP on JBoss (Aspects/JBoss)] - Re: Optimizing Pointcut Matching

kabir.khan@jboss.com do-not-reply at jboss.com
Tue May 13 06:47:40 EDT 2008


We discussed something interesting in Orlando that Flavia brought up. When adding a binding, why are we cleaning out ALL the chains for the affected classadvisors and then iterating over bindings for each joinpoint for that class? 

If we are adding a binding, we could just do the matching for that binding and see if it matches anything within the affected advisors, add it to the end of the interceptor chain if it does, and then sort according to precedence. That will be a lot faster since we don't have to match every joinpoint against every pointcut in the system whenever we add/remove something.

We decided not to do this in Orlando, since the joinpoint graph would handle this. Since the joinpoint graph is not ready yet, I think we should go forward with this solution. We will need to do some additional housekeeping to see which interceptors in the advisor's JoinPointInfo's belong to which AspectBindings, so that we can remove bindings easily without having to recalculate everything.

I think that only time we should need to recalculate everything is if we add annotation overrides or metadata to an advisor, since then it might match more pointcuts 





View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4150316#4150316

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4150316



More information about the jboss-dev-forums mailing list