[cdi-dev] [JBoss JIRA] Commented: (CDI-33) fire ProcessAnnotatedType for AnnotatedTypes added via BBD.addAnnotatedType()

Dan Allen (JIRA) jira-events at lists.jboss.org
Mon Mar 28 16:04:38 EDT 2011


    [ https://issues.jboss.org/browse/CDI-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592239#comment-12592239 ] 

Dan Allen commented on CDI-33:
------------------------------

Reading Aaron's comment, I wonder if perhaps the right solution is adding a source property to the event. That way, if another extension adds a type, the observers can detect it was added by an extension and even get the extension instance. We would then need an interface to identify the scanner, or make the source the BeanManager in that case.

{code:java}
if (event.getSource() instanceof Extension) {
    // we know this type was introduced by an extension
} else {
    // picked up by the scanner
}
{code} 

> fire ProcessAnnotatedType for AnnotatedTypes added via BBD.addAnnotatedType()
> -----------------------------------------------------------------------------
>
>                 Key: CDI-33
>                 URL: https://issues.jboss.org/browse/CDI-33
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>          Components: Portable Extensions
>    Affects Versions: 1.0
>            Reporter: Jozef Hartinger
>             Fix For: 1.1 (Proposed)
>
>
> Currently, the ProcessAnnotatedType event is fired for AnnotatedTypes discovered in a BDA only. However, portable extensions are allowed to register other AnnotatedTypes using addAnnotatedType() during the BeforeBeanDiscovery phase. For these AnnotatedTypes, the ProcessAnnotatedType event is not fired. 
> However, an extension A may register an AnnotatedType X via addAnnotatedType() and an extension B might want to react on the presence of AnnotatedType X. Therefore, it would be great to have the ProcessAnnotatedType fired also for AnnotatedTypes registered programatically in the BeforeBeanDiscovery phase.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the cdi-dev mailing list