Open GoogleCodeExporter opened 9 years ago
Left out main() class pulling it all together.
Original comment by b.k.ox...@gmail.com
on 13 Dec 2012 at 8:20
Attachments:
Your matcher uses:
return type.getRawType().isAnnotationPresent(MBean.class);
but because the AOP proxy class generated by CGLIB doesn't redeclare the class
annotation (and the JEE MBean annotation is not declared as @Inherited) then
this matcher won't match the enhanced instances.
To handle this you need to use something like:
return type.getRawType().isAnnotationPresent(MBean.class) ||
type.getRawType().getSuperclass().isAnnotationPresent(MBean.class);
Note that any generated AOP classes will have 'ByGuice' in their name, so you
could always use this to decide whether to check the superclass or not.
Alternatively you could always walk up the superclass hierarchy which would
then work for other proxied classes from other frameworks.
Original comment by mccu...@gmail.com
on 12 May 2013 at 9:16
Original issue reported on code.google.com by
b.k.ox...@gmail.com
on 13 Dec 2012 at 8:18Attachments: