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

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


Back to the top