[jboss-dev-forums] [Design of EJB 3.0] - EJBTHREE-1800 Improving InjectInterceptorsFactory

jaikiran do-not-reply at jboss.com
Mon Apr 6 04:23:28 EDT 2009


While working on EJBTHREE-1800, i noticed that the InjectInterceptorsFactory while creating a per joinpoint, does the following:

1) Retrieves *all* methods on the interceptor/bean class
2) For each of these methods, checks whether it's overridden
3) If not, then checks whether the method has an @AroundInvoke 

This currently leads to a performance degradation. As the number of methods increase (on the bean or the interceptor class), so does the timing of this logic. 

Keeping in mind, the following requirements in the EJB3 spec:

AroundInvoke methods have the following signature: Object (InvocationContext) throws Exception

the logic in this InjectInterceptorsFactory can be improved as follows:

1) Get only those methods with accept InvocationContext as a param type and return type is Object  (internally we still have to scan all public, private, package etc... methods of the class as per the spec, but filtering out the relevant methods will help in step#2 and #3)
2) For each of these (filtered) methods which follow the AroundInvoke method signature, check if it has a @AroundInvoke declared
3) If there's a @AroundInvoke, then go on to check whether the method is overridden. If yes, ignore. 

Initial local tests with this change, does show some good improvements. Any other thoughts?     

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

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



More information about the jboss-dev-forums mailing list