[cdi-dev] [JBoss JIRA] (CDI-255) Support for Implicit Producers

Pete Muir (JIRA) jira-events at lists.jboss.org
Tue Aug 28 11:45:14 EDT 2012

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

Pete Muir commented on CDI-255:

h3. Proposal

The Java EE container should create a producer for every resource available to the application, following these rules:

* If there is more than one resource of that type available to the container, a producer is not created, and should be aliased using a resource producer
* If the application already defines an enabled bean of that type, the container should not create the producer. OPEN QUESTION: Should the container create a qualified producer in this case?
* The qualifiers should be {{@Default}} and {{@Any}}
* The bean types should be the transitive closure of the type hierarchy of the type of the resource
* The scope should be {{Dependent.class}}

h3. Implementation Notes

* The Java EE container can register each producer using the {{AfterBeanDiscovery.addBean()}} event
* The Java EE container can create the bean by:
*# Implementing the {{Producer}} interface, simply returning the relevant resource (e.g. using a JNDI lookup) in {{produce()}} and doing nothing in {{dispose()}}. The set of injection points can be empty.
*# Calling BeanManager.createBean(), passing in an implementation of {{BeanAttributes}} that implements the requirements described above (with null for name, an empty set for stereotypes, and false for alternative and nullable), the producer created in (1) and the type of the resource for the bean class
*# Calling {{AfterBeanDiscovery.addBean()}} passing in the bean created in (2)
> Support for Implicit Producers
> ------------------------------
>                 Key: CDI-255
>                 URL: https://issues.jboss.org/browse/CDI-255
>             Project: CDI Specification Issues
>          Issue Type: Tracker
>    Affects Versions: 1.0
>            Reporter: Pete Muir
>             Fix For: 1.1.PRD
> An implicit producer could be registered for every unambiguous resource the Java EE container knows about.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the cdi-dev mailing list