gags_78
2008-06-16 11:40:37 UTC
Hey folks,
I'm fairly new to AOP so forgive me for any major gaffes.
I have the following class. It has two private members initialised in the
constructor.
package com.mystuff;
public class MemberAccess{
private String name;
private Object parameter;
public MemberAccess(String name, Object parameter) {
this.name = name;
this.parameter = parameter;
}
public String sayHello() {
return "Hello to " + name + " with object of type " +
parameter.getClass();
}
}
I have an Around advice declared around the sayHello method and in it I'm
using the MethodRtti to
be able to access information about the method and the class, alas as the
members are declared private
in the aspected class I can't seem to access them. Is it possible to access
private members from within the scope of a method advice?
Thanks,
Mark.
I'm fairly new to AOP so forgive me for any major gaffes.
I have the following class. It has two private members initialised in the
constructor.
package com.mystuff;
public class MemberAccess{
private String name;
private Object parameter;
public MemberAccess(String name, Object parameter) {
this.name = name;
this.parameter = parameter;
}
public String sayHello() {
return "Hello to " + name + " with object of type " +
parameter.getClass();
}
}
I have an Around advice declared around the sayHello method and in it I'm
using the MethodRtti to
be able to access information about the method and the class, alas as the
members are declared private
in the aspected class I can't seem to access them. Is it possible to access
private members from within the scope of a method advice?
Thanks,
Mark.
--
View this message in context: http://www.nabble.com/Private-member-access-from-an-Around-joinpoint-on-a-method-tp17862543p17862543.html
Sent from the AspectWerkz - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
View this message in context: http://www.nabble.com/Private-member-access-from-an-Around-joinpoint-on-a-method-tp17862543p17862543.html
Sent from the AspectWerkz - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email