2 Replies Latest reply on Apr 14, 2009 5:53 AM by jaikiran

    Changes to pointcut expressions in ejb3-interceptors-aop.xml

    jaikiran

      Our current pointcut expressions for domains which introduce annotations on joinpoints in ejb3-interceptor-aop.xml don't work as expected. For example:

      <domain name="Stateless Bean" extends="Intercepted Bean" inheritBindings="true">
      ...
      <annotation expr="!class(@org.jboss.ejb3.annotation.Pool)">
       @org.jboss.ejb3.annotation.Pool (value="ThreadlocalPool", maxSize=30, timeout=10000)
       </annotation>
      


      This annotation element is expected to introduce a @org.jboss.ejb3.annotation.Pool on stateless beans (classes) which do not already have this. However this incorrectly introduces the annotation on the bean class, all its fields and all its methods and effectively leads to a performance degradation.

      The pointcut expression needs to be changed to either:

      Carlo's workaround:

      class(*) AND !class(@org.jboss.ejb3.annotation.Pool)


      or what Kabir suggests in http://www.jboss.org/index.html?module=bb&op=viewtopic&t=153447

      class($instanceof{java.lang.Object}) AND !class(@org.jboss.ejb3.annotation.Pool)



      Both these expresssions fix the issue. We need to change the pointcut expression for all those domains which introduce the annotations. I have tested Carlo's workaround on a sample application against the AS. Haven't yet tested the other one (with an EJB app on AS). From my limited knowledge of pointcut expressions, there's not much difference in these 2 expressions, so if there are no objections i'll commit Carlo's pointcut expression (and run the testsuite :) )

      Any thoughts?