]
Antoine Sabot-Durand commented on CDI-492:
------------------------------------------
[~edburns] I understand those concerns, but I think there are solution for most of them.
The points given don't take into account evolutions that could be done in CDI and JSR
330 to make it possible.
To take all the points and give first ideas to solve them :
*backward compatibility* : introducing a qualifier for these beans (like it's done in
Deltaspike to work with CDI 1.0 and 1.1) is a first lead like {{@Servlet}} to tell that
these beans are owned by Servlet spec.
*Dependency on CDI* ; as you know we're going to work on a new AtInject version. We
could imagine having the servlet impl only be dependent on AtInject (which will stay very
small : around 10 interfaces / annotations). The only thing that is missing in AtInject
today is the concept of {{@Producer}} that could be added to this new version (dagger want
to move its {{@Provides}} annotation to AtInject.
The integration can off course be done at spec level (the worse case would be to have a
dependency on CDI API). So I really don't understand Greg point.
For CDI 2.0 our approach is to talk with other specs to see what they need to improve
their CDI integration. So let's talk about these needs before deciding it's not
doable.
Give ownership of servlet specific part to servlet specification
----------------------------------------------------------------
Key: CDI-492
URL:
https://issues.jboss.org/browse/CDI-492
Project: CDI Specification Issues
Issue Type: Feature Request
Components: Java EE integration
Reporter: Antoine Sabot-Durand
[Section 3.8 of the
spec|http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#additional_builtin_...] places
some requirements on CDI implementations when running with Servlet. To better suit user
desires for modularity these requirements are better met by moving them to the Servlet
spec. Specifically,
{quote}
A servlet container must provide the following built-in beans, all of which have
qualifier @Default:
* a bean with bean type {{javax.servlet.http.HttpServletRequest}}, allowing injection of
a reference to the HttpServletRequest
* a bean with bean type {{javax.servlet.http.HttpSession}}, allowing injection of a
reference to the HttpSession,
* a bean with bean type {{javax.servlet.ServletContext}}, allowing injection of a
reference to the ServletContext,
These beans are passivation capable dependencies, as defined in Passivation capable
dependencies.
{quote}