[cdi-dev] [JBoss JIRA] (CDI-194) Allow AnnotatedType for a given Bean to be obtained
Vivian Steller (JIRA)
jira-events at lists.jboss.org
Sun Sep 2 12:07:32 EDT 2012
[ https://issues.jboss.org/browse/CDI-194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12715298#comment-12715298 ]
Vivian Steller commented on CDI-194:
------------------------------------
Jozef, you're right. In fact, the method isn't helpful when observing the ProcessBean event. However, Bean[Attributes].getAnnotated[Type]() is useful at runtime, during the lifetime of the application: it would allow to access the AnnotatedType for a given type at any point in time. I don't know whether BeanManager.createAnnotatedType() (see CDI-83) was supposed to realize this?
Moreover, I want to clarify my previous comments: Pete was perfectly right, observing the ProcessAnnotatedType rather than the ProcessBean event would be correct. ProcessAnnotatedType is fired for really every class/abstract class/interface/... found in bean archives, while ProcessBean is only fired for those types identified as Beans. As abstract types aren't considered Beans, the behavior is perfectly correct. So, in my code, I really should have been observing the ProcessAnnotatedType event, which makes the entire typeClosureLoop and asAnnotated method obsolete. I remember that I used ProcessBean event, to guarantee that Seam Solder's extension has merged in all XML defined configuration changes. At the moment, I don't know whether this issue is still valid or not. I've to investigate this and will come back to you.
> Allow AnnotatedType for a given Bean to be obtained
> ---------------------------------------------------
>
> Key: CDI-194
> URL: https://issues.jboss.org/browse/CDI-194
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Components: Portable Extensions
> Affects Versions: 1.0
> Reporter: Jozef Hartinger
> Fix For: 1.1 (Proposed)
>
>
> See Stuart's comment on CDI-83.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the cdi-dev
mailing list