Re: about PointCut selection and Context Parameter
"Jonas Bonèr" <[email protected]> Sat, 19 Apr 2003 14:01:22 +0200
| Newsgroups | gmane.comp.java.aspectwerkz |
|---|---|
| Message-ID | <[email protected]> |
Hi shiyiying. 1. Your suggestion of being able to change the parameters is a good idea. I= t will be very simple to add and I will add it until the next release.=20 2. I have not had the time to document this feature yet but basically it w= orks like this: add javadoc tags to your code like:=20 /** * attributes:method log */ and then set the advice to apply at all the places where you have the log a= ttribute by specifying: <advice ... attribute=3D"log"/> Take a look in the logging example to see it in action. 3. Actually the FieldAdvices are Pre and Post advices. You really don't hav= e to call proceed(); (doesn't do anything in this case). I understand tha= t I have not been so clear on this and I will change it to be more explic= it until the next release. Thanks for your interest and for trying aspectwerkz out. Sincerely, Jonas=20 -----Original Message----- From: =11=E1 <[email protected]> To: [email protected] Date: Sat, 19 Apr 2003 04:55:28 +0000=20 Subject: [aspectwerkz-developer] about PointCut selection and Context Param= eter Hi Jonas: Aspectwerkz seems very different from other's aop frameworks. I think it is= =20 "practical" AspectJ. But I have some questions: 1.In AspectJ, you can select a PointCut by combine some conditions,and can= =20 provide some parameters, such as: pointcut setXY(FigureElement fe, int x, int y): call(void FigureElement.setXY(int, int))=20 && target(fe)=20 && args(x, y); around(FigureElement fe, int x, int y): setXY(fe, x, y) { System.out.println(fe + " moved to (" + x + ", " + y + ")."); x++; proceed(fe,x,y); } in this around advice, we can change x's value , and proceed to next=20 advice(or org method) with the new parameter. But in Aspectwerk,jointpoint proceed() has no parameter.Is it means we=20 cannot change parameter like AspectJ? 2.How can I select PointCut by attribute(and combine with others)? 3.Would Aspectwerkz implement PreAdvice,PostAdvice and Around advice like= =20 AspectJ? Now in Aspectwerkz,every advice is around advice. For example, can we just declare a PreAdvice in XML, and in this advice class's execute method, we can just do our aspect thing,and need not to invoke proceed method? Best regards shiyiying _________________________________________________________________ =AB(=16L =00'=845P=AE=F6=FB=DF=15 MSN Hotmail=02 http://www.hotmail.com ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ aspectwerkz-developer mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/aspectwerkz-developer - Jonas ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf