[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Re: [NEWSDELIVER] Re: Load Time Weaving AspectJ 5


Mouna,

If you want your aspects to only affect certain classes or certain methods within those classes then you should be writing pointcuts. The aop.xml specification is not designed to meet the needs of AOP. However in your situation if you don't want to use a particular aspect use an "exclude" clause in the "aspects" section; this will apply to all classes. If you don't want to weave a particular set of classes use an "exclude" clause in the "weaver" section; this will apply to all aspects. If you want to pick and choose combinations of aspects and class or selection certain methods then use a pointcut.

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx

http://w3.hursley.ibm.com/~websterm/

To:        undisclosed-recipients:;
cc:        
Subject:        [NEWSDELIVER] Re: Load Time Weaving AspectJ 5



I have run my example when separating the apsects and java classes into
two projects, and I could exclude weaving classes of a specific package.
I mean that by using the following aop.xml:

<?xml version="1.0" encoding="UTF-8"?>
<aspectj>
                <aspects>
                                 <aspect name="monPAck.MonAspect2"/>
                                 <aspect name="monPAck.MonAspect1"/>
                </aspects>
                <weaver options="-verbose">
                                 <exclude within="test..*"/>
                </weaver>
</aspectj>

No apsect has been weaven to classes of the package "monPack".
But I want to specify the method or the class to exclude!
Thus, when I tried  with:
<exclude within="test.Hello.sayHello(..)"/> or <exclude
within="test.Hello.*"/>
that dosent work!
The same thing when I use <exclude within="monPAck.MonAspect1"/>, I
expected to not weave the aspect MonAspect1 to any class. It still be
weaved!

Is it normal? Has anyone tried to do the same? Thank you fir your help.

Mouna