[cdi-dev] [JBoss JIRA] (CDI-231) Clarify if Alternatives are filtered in BeanManager#getBeans() or #resolve()

Gerhard Petracek (JIRA) jira-events at lists.jboss.org
Tue May 22 18:01:18 EDT 2012

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

Gerhard Petracek commented on CDI-231:

simple constellation:
if an alternative bean is activated, the type-information (/-meta-data) of the original bean should be changed.
(-> beans without a type and name can be removed completely).

shared-lib constellation:
an alternative bean (for a bean in a shared lib) which isn't enabled for all applications leads to the same change of the type-meta-data. however, instead of changing the original meta-data which is still needed by other applications, the change should be done on a copy which is kept at the first lookup level.
-> applications which should use the alternative bean will only see this one and >not< the original bean
-> applications which should not use the alternative bean will only see the original bean (in the second lookup level)
> Clarify if Alternatives are filtered in BeanManager#getBeans() or #resolve()
> ----------------------------------------------------------------------------
>                 Key: CDI-231
>                 URL: https://issues.jboss.org/browse/CDI-231
>             Project: CDI Specification Issues
>          Issue Type: Clarification
>          Components: Resolution
>    Affects Versions: 1.0, 1.1.EDR1
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1 (Proposed)
> The spec and javadoc are not really clear if the @Alternative filter defined in "5.2.1. Unsatisfied and ambiguous dependencies" is already performed in BeanManager#getBeans() or only later in BeanManager#resolve().
> Back in 2009 I did a blind test with an old Weld version which only returned @Alternatives in getBeans() and all other beans got filtered out. This seems to have changed now (since quite some time). 
> Can we make this more clear what should happen in getBeans() and what should happen in resolve()?

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