RE: [aspectwerkz-user] Multiple aspects using the same advice fun ction
"Kreinick, Michael H." <[email protected]>
| Newsgroups | gmane.comp.java.aspectwerkz.user |
|---|---|
| Message-ID | <F48A26BC9CC4D44685BC2C2DD669958911CA7E@gsnmp03es.firmwide.corp.gs.com> |
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-----