Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] QUESTION: Optimizing pointcuts for performance

I have a number of pointcuts which look at lot like these below. I don't know what packages they will be found in. I do know that they will not be in java.* or javax.*. Can someone tell me how best to create the highest performing pointcuts without knowing which packages they will be part of or just other general tips.

Bootstrap is an "interface"

-- note using call
   public pointcut Bootstrap_new() :
       // notwithinThis() &&
       // withincode(* com..*(..)) &&
       call(Bootstrap+.new(..));

-- note using execution
   public pointcut Bootstrap_onInstall(
Bootstrap object) : // notwithinThis() &&
       execution(public void onInstall()) &&
       this(object);


My aop.xml file looks like. How does my aop.xml affect the weaving (LTW).

<aspectj>
   <aspects>
       <aspect name="mypackage.MyAspect" />
       <!--
           <include within="com..*"/> -- WHAT MIGHT THESE DO?
           <include within="java..*"/>
           <include within="javax..*"/>
           <include within="org..*"/>
       -->
   </aspects>
   <weaver options="-XmessageHandlerClass:mypackage.AspectJMessageHandler">
       <!--
           <include within="java..*"/> -- WHAT MIGHT THESE DO?
           <include within="javax..*"/>
           <include within="org..*"/>
           <include within="com..*"/>
           <exclude within="mypackage.*"/>
       -->
       <!--
           <dump within="java..*"/>
           <dump within="javax..*"/>
           <dump within="org..*"/>
           <dump within="com..*"/>
       -->
   </weaver>
</aspectj>


Back to the top