Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Retrieving value whilst using the "get" primitive

(NOTE: If anybody has a way of being able to do meaningful searches on "get"
and "set" then let me know.  I have searched the web for my question below
and am stymied by how to actually perform the search)

Hi all,

I am playing around with the "get" and "set" primitives and am not having
luck gaining access to the variable that is being retrieved with the "get". 
The set works fine.  The following code allows me to gain access to the
variable (isCacheEnabled) that is being set along with the new value that
the value is being set to.

before(Boolean newval): set(Boolean ReferenceDataWorker+.isCacheEnabled) &&
args(newval) {
	System.out.println("isCacheEnabled has been set and the new value is " +
newval);
}

This works great and I am able to print out the new value that
isCacheEnabled is being set to.  The same cannot be said for when I use the
"get" primitive.  Obviously I do not have the argument available since there
is no argument.  I am trying to print out the value of isCacheEnabled before
(or after for that matter) its retrieved.

before(): get(Boolean ReferenceDataWorker+.isCacheEnabled) {
	System.out.println("isCacheEnabled has been retrieved and the value is " +
isCacheEnabled);
}

My question is: How do I gain access to the "isCacheEnabled" variable when
using the "get" primitive?  If anyone has anymore useful tips on gaining
access to variables then that would be great as well.  I have tried
understanding "this", "target" etc but I think I am missing something
fundamental.

Any help greatly appreciated.

Cheers
Tom
-- 
View this message in context: http://aspectj.2085585.n4.nabble.com/Retrieving-value-whilst-using-the-get-primitive-tp3179362p3179362.html
Sent from the AspectJ - users mailing list archive at Nabble.com.


Back to the top