Re: [aspectwerkz-user] Multiple aspects using the same advice fun ction
Alexandre Vasseur <[email protected]>
| Newsgroups | gmane.comp.java.aspectwerkz.user |
|---|---|
| Message-ID | <[email protected]> |
As per the DTD (exerpt below) this is a bug. <!ELEMENT advice ( 200 bind-to* 201 )> 202 <!ATTLIST advice 203 name CDATA #REQUIRED avasseur 1.3 204 type CDATA #REQUIRED avasseur 1.1 205 bind-to CDATA #IMPLIED 206 attribute CDATA #IMPLIED 207 > 208 <!--***************************************************************************************************************************** 209 bind-to 210 ********************************************************************************************************************************* 211 Allow to bind an advice several times instead of using an OR expression 212 ******************************************************************************************************************************--> 213 <!ELEMENT bind-to EMPTY> 214 <!ATTLIST bind-to 215 pointcut CDATA #REQUIRED 216 > On Apr 8, 2005 6:18 PM, Kreinick, Michael H. <[email protected]> wrote: > We're planning to automatically generate the xml file so it would have been > easier to either generate two pointcuts or use the <bind-to> form. We can do > ORs, if this isn't going to work. Still, should I report it as a bug? > -Michael > > -----Original Message----- > From: Alexandru Popescu [mailto:[email protected]] > Sent: Friday, April 08, 2005 1:11 PM > To: [email protected] > Subject: Re: [aspectwerkz-user] Multiple aspects using the same advice > function > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > [quote Kreinick, Michael H.::on 4/8/2005 5:54 PM] > > There seems to be a problem using more than one pointcut on one > > advice. Only one of the pointcuts is actually used. We tried this form: > > > > <aspect class="HelloWorldHijacker"> > > <pointcut name="greetMethod" expression="execution(* > > testAOP.HelloWorld2.greet(..))"/> > > <pointcut name="fooMethod" expression="execution(* > > testAOP.HelloWorld2.foo(..))"/> > > > > <advice name="functionName" type="around" > bind-to="greetMethod"/> > > <advice name="functionName" type="around" > > bind-to="fooMethod"/> </aspect> > > > > And this form: > > > > <aspect class="HelloWorldHijacker"> > > <pointcut name="greetMethod" expression="execution(* > > testAOP.HelloWorld2.greet(..))"/> > > <pointcut name="fooMethod" expression="execution(* > > testAOP.HelloWorld2.foo(..))"/> > > <advice name="functionName" type="around"> > > <bind-to pointcut="greetMethod"/> > > <bind-to pointcut="fooMethod"/> > > </advice> > > </aspect> > > > > But in both cases the advice was applied only to greet. Given that the > > second is in the DTD I would have expected it to work. Is this a bug? > > -Michael > > > Why aren't you using greetMethod OR fooMethod instead of trying to bind it > twice? > > - -- > :alex |.::the_mindstorm::.| > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.0 (MingW32) > > iD8DBQFCVrslOCPjdDT2FEURApC3AJ49draBKqdCIZdgnIy0L+CurXTnNACfSQx7 > 0+2TQHgwgkkwgrjgPEeLxRk= > =iLbe > -----END PGP SIGNATURE----- >