Since I have beans that are being advised and also exported as mbeans -- and that works -- I decided to look at AbstractMBeanInfoAssembler. Appearently, it makes an explicit check to see if the class has cglib-proxied:
Code:
protected Class getClassToExpose(Object managedBean) {
if (AopUtils.isCglibProxy(managedBean)) {
return managedBean.getClass().getSuperclass();
}
return managedBean.getClass();
}
But I'm still not sure if the reason was because the method annotations are stripped from the cglib-proxied subclass. If so, I'm in trouble, because the method I'm trying to introduce defines an annotation that needs to processed at runtime. Therefore I cannot simply upcast like the snippet above (ie, I need to see the methods on the subclass as well).