Re: about PointCut selection and Context Parameter

Jonas Bonér <[email protected]> Tue, 22 Apr 2003 22:45:19 +0200
Newsgroups gmane.comp.java.aspectwerkz
Message-ID <[email protected]>
Hi Shiyiying.

It is actually possible to change the parameters in the current version
of AspectWerkz.

You simple cast the JoinPoint to f.e. MethodJoinPoint and call the
setParameters(Object[] params) method for changing the parameters.

The parameters are held within the JoinPoint class and are not passed
explicitly through the proceed() method as in AspectJ.

Best regards.

Jonas.



 娑 wrote:
> Hi Jonas:
> 
> Aspectwerkz seems very different from other's aop frameworks. I think it 
> is "practical" AspectJ.
> But I have some questions:
> 1.In AspectJ, you can select a PointCut by combine some conditions,and 
> can provide some parameters, such as:
> 
> pointcut setXY(FigureElement fe, int x, int y):
>   call(void FigureElement.setXY(int, int))   && target(fe)   && 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 
> advice(or org method) with the new parameter.
> But in Aspectwerk,jointpoint proceed() has no parameter.Is it means we 
> 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 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
> 
> _________________________________________________________________
> 享用世界上最大的电子邮件系统― MSN Hotmail。  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
http://freeroller.net/page/jboner





-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf