I am very proud to announce the very first alpha release of Weld 2. Weld is the reference implementation of Contexts and Dependency Injection for Java EE (CDI). In the 2.x series of Weld releases, we will be focusing on JSR-346 which is the next version (1.1) of the CDI specification.
The Alpha1 release is a feature-complete implementation of the Early Draft of CDI 1.1. Pete blogged about the news in the early draft some time ago. The following list just highlights some of the new features I consider the most important:
- Ability to access the CDI container from anywhere simply by calling CDI.current()
- Conversations in plain Servlet requests
- Application lifecycle events in Java EE
- Injection into enums
- Ability to override attributes of a Bean via BeanAttributes
- Ability to process modules and manipulate the content of the beans.xml file via ProcessModule
- Ability to wrap the InjectionPoint
- Injection of Bean metadata into bean instances
- Programmatic access to a container provided Producer, InjectionTarget, AnnotatedType
The main reason for building a reference implementation is to prove a specification and reveal potential problem early. While implementing the Early Draft of JSR-346, several issues emerged that were previously unseen. If you are interested in these issues or have an idea of how to address them, feel free to share you opinions in the issue comments or the JSR-346 mailing list. Also, if you want to contribute to Weld 2, now is the right time. Since we are hosted on github forking and playing with Weld is extremely easy.
In addition to our efforts on the Weld side, Martin Kouba has been working on the Technology Compatibility Kit (TCK) for JSR-346. The Alpha1 version of the CDI 1.1 TCK is released along with the Weld release. Martin did a great job and delivered a solid test coverage of the new features. He also migrated the entire testsuite to Arquillian, which enabled us to develop new tests faster while at the same time using more extensive scenarios (such as multiple web applications inside of an enterprise archive).
Weld and CDI TCK artifacts can be obtained from Maven or from a distribution bundle (see the links below). We tried our best to make it easy for you to test-drive the new features. Therefore, we also provide a special build of JBoss AS 7.1.0.CR1 enhanced with Weld 2 :-)
For the next release (Alpha 2), our plan is to look into improving non-functional characteristics of Weld such as memory footprint and start-up time.