Weld 1.1, the reference implementation of JSR-299: Contexts and Dependency Injection is based on the CDI 1.0 API. Weld is being integrated into the JBoss Application Server, and version 1.1 should be available in the next release of JBoss AS 6.0. Until then you'll need to use a snapshot build of JBoss AS. Weld is also used in GlassFish v3 and supports several servlet containers such as Tomcat and Jetty.
Here are some of the new features in Weld 1.1:
- Weld has migrated to Google Guava from google-collections
- New EJB 3.1 features displayed in the new Pastecode example
- Improvements in error reporting
- Better memory usage
- Unsafe instantiators
- A new proxy layer that doesn't suffer from the memory leaks in Javasssist
- About 60 bugfixes
Weld 1.1 also has the ability to exclude classes from being scanned and then deployed as beans. This is achieved by configuring the beans.xml for the bean archive being deployed. beans.xml may be parsed outside of Weld.
Here's an example of the configuration:
<beans xmlns="http://java.sun.com/xml/ns/javaee"Another way to use Weld is with Java SE. There is also strong support for Weld in the emerging Arquillian testing framework, which allows you to test in Weld SE, Tomcat, Jetty, JBoss AS, GlassFish, or a mocked out Java EE container.
<!-- Don't include GWT support if GWT is not installed -->
You can find the 1.0.2 version of the CDI TCK here.