[weld-issues] [JBoss JIRA] Commented: (WELD-814) Resources injected to producer fields fail to be produced

Pete Muir (JIRA) jira-events at lists.jboss.org
Sun Jan 2 11:29:17 EST 2011


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

Pete Muir commented on WELD-814:
--------------------------------

The key difference between the two approaches above is that in resource producer field you are, in essence, "aliasing" that resource as a CDI bean with a specified qualifier and type. CDI is responsible for managing the lifecycle, and the only lifecycle that generally makes sense is dependent scoped. In the case of a resource injection + producer method, you are injecting a resource and taking control of it's lifecycle yourself via the producer method that exposes it.

IOW in the second case you are taking responsibility for the lifecycle of the resource instance and thus can choose whatever scope you want.

> Resources injected to producer fields fail to be produced
> ---------------------------------------------------------
>
>                 Key: WELD-814
>                 URL: https://issues.jboss.org/browse/WELD-814
>             Project: Weld
>          Issue Type: Bug
>    Affects Versions: 1.1.0.CR3
>            Reporter: John Ament
>            Assignee: Pete Muir
>
> When you inject a resource in to a bean (session, managed, cdi, etc), the producer field that can be bound to it fails to deploy, at least under AS 6.  

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

        


More information about the weld-issues mailing list