JSR-346 for new CDI 1.1
There is a new Java Specification Request (JSR) with number 346: Contexts and Dependency Injection for JavaTM EE 1.1.
It contains improvements for CDI 1.0, and is led by Red Hat.
CDI might be the most helpful new piece of technology in Java EE 6. If you haven't heard of it or didn't use it before, then try Adam Bien's articles or the documentation of CDI's reference implementation, called Weld, which is actuaaly quite easy to read.
So what are the suggestions for CDI 1.1? Let's look what the JSR says:
Published at DZone with permission of its author, Thomas Eichberger.It contains improvements for CDI 1.0, and is led by Red Hat.
CDI might be the most helpful new piece of technology in Java EE 6. If you haven't heard of it or didn't use it before, then try Adam Bien's articles or the documentation of CDI's reference implementation, called Weld, which is actuaaly quite easy to read.
So what are the suggestions for CDI 1.1? Let's look what the JSR says:
- "Global ordering of interceptors and decorators, as well as global enablement of alternatives [CDI-48]
- An API for managing built in contexts, allowing the built in implementation of the conversation context to be used outside of JSF [CDI-30]
- An embedded mode allowing startup outside of a Java EE container [CDI-26]
- Declarative control over which packages/classes are scanned in a bean archive [CDI-87]
- Bean declaration at constructor level [CDI-55]
- Static injection [CDI-51]
- Inclusion of @Unwraps from Seam Solder [CDI-89]
- Align with current version of @Inject [CDI-51]
- Numerous minor enhancements to the Portable Extensions SPI
- Client controlled contexts allowing for SaaS style multi-tennancy [CDI-103]
- Better support for CDI in libraries when used in the Java EE platform [CDI-84]
- Send CDI events for Servlet events [CDI-38]
- Application lifecycle events [CDI-86]"
The final release of CDI 1.1 is currently scheduled for Q3 2012.
This post was originally published on thomas-eichberger.blogspot.com.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)





Comments
Jonathan Fisher replied on Wed, 2011/04/13 - 8:15pm
Cloves Almeida replied on Wed, 2011/04/13 - 8:59pm
Pretty good enhancement. The spec should be less coupled to JSF and Servet technologies. One example is about the Conversation scope being bound to JSF lifecycle.
Another is the Session scope completely bound HTTP session as implemented by Servlet spec. It provides no semantics for non-Servlet stateful remoting technologies, like RMI, XMLRPC, or even HTTP implemented in a servlet-less fashion as in the Play! framework.
hantsy bai replied on Wed, 2011/04/13 - 11:33pm
I hope in next Java EE, bean(ManagedBean, EJB Session Bean/MDB, CDI Bean, JSF ManagedBean) and scope( scope should be used in JSF, Servlet, CDI and none-web client, currently the JSF and CDI defined their own SCOPE ) definition can be united for all Java EE feature, make it look smooth like Spring.
Additionally, the JSF 2.0 defined a Project Stage, it is good for development, testing and deployment. I think it can be promoted a global scope and can be accessed in all Java EE features. Please provide the same feature of Enviroment and Profile in Spring 3.1. This maybe little interest CDI.
Khent Johnson replied on Fri, 2011/09/02 - 3:27pm
Pippifin Cakasey replied on Sat, 2011/10/22 - 8:28am