Re: [aspectwerkz-dev] value of 'this' when a mixin method is executed
"Michael Nascimento Santos" <[email protected]>
| Newsgroups | gmane.comp.java.aspectwerkz.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Chris,
If you have a CrossCuttingInfo info instance, you can use
info.getMixinTargetInstance(this) to get the target instance or
getMixinTargetClass(this) to get the target class.
In order to have a CrossCuttingInfo instance, you have to declare it as the
sole parameter of your class constructor, such as:
public class MyMixin {
private CrossCuttingInfo info;
public MyMixin(CrossCuttingInfo info) {
this.info = info;
}
}
Also, notice that questions like these should be posted to the user list,
not the dev.
Regards,
-------------------------------------------------------------
Michael Nascimento Santos
JSR 207 Expert Group Member
JSR Community Manager - http://community.java.net/jsr
Organizacao SouJava - http://www.soujava.org.br
Thinlet - http://www.thinlet.com
http://www.javablogs.com.br/blogs/page/soujavamisterm
http://today.java.net/pub/au/80
----- Original Message -----
From: "christoph sturm" <chrisml-Ws/[email protected]>
To: <[email protected]>
Cc: <[email protected]>
Sent: Monday, July 26, 2004 12:20 PM
Subject: [aspectwerkz-dev] value of 'this' when a mixin method is executed
> Hi ALl!
>
> I have a perInstance Mixin, and when i invoke a method of the mixin,
> 'this' points to the mixin class and not to the target class. So i end
> up passing 'this' around. is there a better solution?
>
> thanks
> chris
>