[cdi-dev] [JBoss JIRA] (CDI-200) ProcessBeanAttributes needs clarification

Jozef Hartinger (Created) (JIRA) jira-events at lists.jboss.org
Mon Dec 12 03:58:09 EST 2011


ProcessBeanAttributes needs clarification
-----------------------------------------

                 Key: CDI-200
                 URL: https://issues.jboss.org/browse/CDI-200
             Project: CDI Specification Issues
          Issue Type: Clarification
          Components: Portable Extensions
    Affects Versions: 1.1.EDR1
            Reporter: Jozef Hartinger
             Fix For: 1.1 (Proposed)


The specification should clarify the following cases:
* whether the ProcessBeanAttributes event should be fired for Beans registered using AfterBeanDiscovery.addBean() - if yes, it is necessary to clarify what would the value returned by PBA.getAnnotated() be.
* whether the ProcessBeanAttributes event should be fired for built-in beans (my interpretation is that this is not required)

The attributes represented by a BeanAttributes object are not completely independent. It is necessary to clarify how the set BeanAttributes object is treated. I can see two options:
* the container takes the final values of a BeanAttributes object and uses them
* the container itself updates certain attributes to match CDI rules for example
** if an extension adds a @Named qualifier to the set of qualifiers, this change is automatically reflected within the name attribute
** if an extension adds a stereotype, which is (transitively) annotated with @Named, the default name is implied and reflected within the name attribute
** if an extension adds a stereotype, which is (transitively) annotated with @Alternative, this fact is reflected within the isAlternative attribute
** if an extension adds a stereotype, which is (transitively) annotated with a scope annotation, this fact is reflected within the scope attribute
In theory, conflicts may occur where for example an extension may set different values for the @Named qualifier and for the name attribute. With the latter approach, an extension loses part of the control. On the other hand, this approach may be more convenient.

Another area that needs clarification is specialization. Suppose having beans A and B where B specializes A. According to the specification, the result of specialization should be visible at the time the ProcessBeanAttributes event is fired for B (the qualifiers and name of B are updated with values of A). The scenarios that need clarification are:
* In the ProcessBeanAttributes phase, a qualifier is added to A (making B no longer a valid substite of A). Should the container detect this as a definition error or rather apply specialization (update the set of qualifiers of B) once again? The same applies for name. 
* Similarly, the set of qualifiers of B may be reduced by an extension, causing the same problem.


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