[cdi-dev] [JBoss JIRA] (CDI-294) Clarify that a Java EE component definition never results in a managed bean being created

Pete Muir (JIRA) jira-events at lists.jboss.org
Wed Dec 5 12:31:21 EST 2012


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

Pete Muir commented on CDI-294:
-------------------------------

Bill Shannon recommends that we approach we take is not to forbid managed beans being created (as this requires CDI to know about all types it shouldn't create) but instead advise that these classes should not have observer methods or producer methods defined on them, nor should they be injected anywhere, stating the reason that you get a new instance (which may be unexpected). We might even go so far to recommend they are annotated @Vetoed?
                
> Clarify that a Java EE component definition never results in a managed bean being created
> -----------------------------------------------------------------------------------------
>
>                 Key: CDI-294
>                 URL: https://issues.jboss.org/browse/CDI-294
>             Project: CDI Specification Issues
>          Issue Type: Clarification
>          Components: Beans, Java EE integration
>    Affects Versions: 1.0
>            Reporter: Jozef Hartinger
>            Assignee: Pete Muir
>             Fix For: 1.1 (Proposed)
>
>
> Having e.g. a Servlet that matches managed bean requirements, there is nothing in the spec saying that the container should not take the servlet class and make a managed bean out of it. This results in ProcessInjectionTarget being fired twice. Furthermore, it does not actually make any sense to have Java EE component definitions (e.g. Servlets) to act as managed beans.

--
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