-
Feature Request
-
Resolution: Obsolete
-
Minor
-
None
-
2.Future
-
None
The 2.0 specification states that scope annotations with attributes result in non-portable behavior:
https://docs.jboss.org/cdi/spec/2.0/cdi-spec.html#defining_new_scope_type
At the same time Java EE standards like JSF use attributes on some of their scope annotations.:http://docs.oracle.com/javaee/7/api/javax/faces/flow/FlowScoped.html
There are use cases of applications that have a well defined structure, but the user must specify multiple copies of that structure. One can imagine a server application that must handle multiple endpoints, so the user must have the means to create multiple copies of a request processing pipeline. E.g. @RequestScoped("login"), @RequestScoped("shopping-card").
Ideally CDI should use annotation instances, rather than annotation classes to select contexts.
http://docs.jboss.org/cdi/api/2.0/javax/enterprise/inject/spi/BeanAttributes.html#getScope--
http://docs.jboss.org/cdi/api/2.0/javax/enterprise/inject/spi/BeanManager.html#getContext-java.lang.Class-
http://docs.jboss.org/cdi/api/2.0/javax/enterprise/context/spi/Context.html#getScope--
If this is not possible at least BeanAttributes can have a convenience method to get the scope annotation instance, and the specification should explicitly allow the use of attributes on scope annotations.
The CDI project is part ofJakarta and uses GitHub issues as it's issue tracking system.
Therefore, all issues in CDI JIRA project are being bulk-closed as described in this GitHub issue.
If you feel like this particular issue deserves ongoing discussion, investigation or fixes in CDI/CDI TCK, please create a new issue under GitHub repository and include a link to this JIRA.
For specification related question/issues, please use - https://github.com/eclipse-ee4j/cdi/issues
For CDI TCK related questions/issues, please use - https://github.com/eclipse-ee4j/cdi-tck/issues