[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: MDR doesn't work on annotated privates
adrian@jboss.org
do-not-reply at jboss.com
Wed Aug 13 05:32:23 EDT 2008
"wolfc" wrote :
| What is the exact function of MethodSignature as opposed to Method?
The idea is that eventually MDR will support loading annotations before the
class is loaded, e.g. for AOP using javassist in that case
you can't use the Method as the key, you've got to use the "signature".
Of course, people that use it at runtime can still use the Method.
Your problem is that there is no way to define @Inherited for a non-class Annotation.
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/annotation/Inherited.html
Sub.class.getMethod("postConstruct").getAnnotation(PostConstruct.class) == null
is the correct behaviour absent some other semantic/hack
and therefore it should be the behaviour of the MetaData.
We could try to simulate this behaviour where you could configure
somewhere that @PostConstruct should do an @Inherited like behaviour
at the method level then make the
AnnotatedElementMetaDataLoader
do the extra work for those annotations.
I remember discussing this issue about 6 months ago?
e.g. whether it should also search interfaces (with the multiple inheritance
problem it would cause) but nothing came of the discussion.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4170268#4170268
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4170268
More information about the jboss-dev-forums
mailing list