-
1. Re: Methods via Reflection and MBean interception
kabirkhan Dec 17, 2004 6:21 AM (in response to jlukiano)Intereptors/aspects bound to exexcution pointcuts for fields and constructors don't get invoked.
Could you please let us know where the discrepancies are? Anyway this is correct :
To my mind, the method interception was the only that wouldn't cause bytecode transformation on the caller classes, due to the called class could have the original method renamed and replaced by a new one, that would fire the interceptions, so methods executed via Reflection would be intercepted if set up so.
Regarding interceptions of field reads in MBeans, I have not yet tried. I will try to take a look over the next week or so. -
2. Re: Methods via Reflection and MBean interception
dimitris Dec 17, 2004 7:05 AM (in response to jlukiano)Now, I'm intruding here from another forum :)
You can apply interceptors to MBeans (either statically or dynamically) by wrapping the MBean with an XMBean descriptor.
Those interceptors come from the JBossMX framework (nothing to do with the AOP framework), so they are old style ones (no bytecode magic whatsoever), and they let you intercept JMX operations and attribute get/sets. -
3. Re: Methods via Reflection and MBean interception
kabirkhan Dec 19, 2004 5:50 PM (in response to jlukiano)Hi there,
You can also instrument MBeans via AOP.
The assumption that fields of an MBean are accessed via reflection is false. For standard and XMBeans the MBean attributes are accessed by the MBean server via a set/get method (), and the set/getMethod() is what accesses the field, so instrumentation takes place normally (i.e. no reflection) on the MBean class itself. This should also be the case for dynamic MBeans unless you use reflection in your set/getAttribute() methods. I have updated the injboss example in cvs to include AOP interceptin of a standard MBean.
Kabir