Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] A question about advice

Sure, I meant Aspect_one.aspectOf().setUserList(usrlist)

Eric

----- Original Message ----- From: "Cong" <yuncong@xxxxxxxxx>
To: <aspectj-users@xxxxxxxxxxx>
Sent: Monday, March 14, 2005 10:25 PM
Subject: Re: [aspectj-users] A question about advice


Thanks for your answer, Eric. For the first solution, if an updated
usrlist is needed, then I have to define any method call that modifies
the usrlist as join points. It seems not a good choice. For your
second solution, I don't understand it quite well.
"UserRecord.aspectOf().setUserList(usrlist)", to my understanding,
aspectOf() is used with an aspect. But UserRecord is a class. ... a
little bit confused *-)

On Mon, 14 Mar 2005 20:53:25 -0600, Eric Bodden <eric@xxxxxxxxx> wrote:
> This aspect contains an error - usrlist is not defined. And my
> question is that is there anyway for the aspect code to get the
> reference of the usrlist object defined in the main()?
There are several ways to do so. You could intercept the creation of the
list and store a reference in the aspect. Also you could explicitly spass
the reference to the aspect using something like
"UserRecord.aspectOf().setUserList(usrlist)", which of course implies that
you have a matching method defined in the aspect.

Eric

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users





Back to the top