I'm pleased to say that CDI 1.1 is available and included in Java EE 7. If you want to learn more, read on, and join a webcast 12th June about all the technologies in Java EE 7. Both webcasts are followed by a Q&A session, when CDI experts will be on hand to answer your questions. The webcast is at [9 am PT / 12 pm ET / 5 pm London] or [9 pm PT / 12 am ET (Thursday) / 2 pm Sydney (Thursday)]
So, what's new in CDI 1.1?
- Add global enablement of interceptors (see the Java Interceptors Specification 1.2), global enablement of decorators (see http://docs.jboss.org/cdi/spec/1.1/cdi-spec.html#enabled_decorators_priority) and alternatives (see http://docs.jboss.org/cdi/spec/1.1/cdi-spec.html#unsatisfied_and_ambig_dependencies) using the @Priority annotation
- Add support for @AroundConstruct lifecycle callback for constructors (see the Java Interceptors Specification 1.2)
- Allow binding interceptors to constructors
- Moved interceptor binding to interceptors spec, allowing for reuse by other specifications
- Support decorators on built in beans (see http://docs.jboss.org/cdi/spec/1.1/cdi-spec.html#decorators)
- Add EventMetadata (see http://docs.jboss.org/cdi/spec/1.1/cdi-spec.html#event_metadata) to allow inspection of event metadata
- Add @Vetoed annotation allowing easy programmatic disablement of classes (see http://docs.jboss.org/cdi/spec/1.1/cdi-spec.html#what_classes_are_beans
- Many improvements for passivation capable beans, including @TransientReference allowing instances to be retained only for use within the invoked method or constructor (see http://docs.jboss.org/cdi/spec/1.1/cdi-spec.html#passivation_capable_injection_points and http://docs.jboss.org/cdi/spec/1.1/cdi-spec.html#passivating_scope)
- Add scope activation and destruction callback events (see http://docs.jboss.org/cdi/spec/1.1/cdi-spec.html#builtin_contexts)
- Add AlterableContext allowing bean instances to be explicitly destroyed (see http://docs.jboss.org/cdi/spec/1.1/cdi-spec.html#context)
- Add automatic enablement of CDI for beans with a scope annotation, and EJBs, in Java EE (see http://docs.jboss.org/cdi/spec/1.1/cdi-spec.html#bean_discovery)
- Add class exclusion filters to beans.xml to prevent scanning of classes and packages (see http://docs.jboss.org/cdi/spec/1.1/cdi-spec.html#bean_discovery)
- Add Unmanaged allowing easy access to non-contexutal instances of beans (see http://docs.jboss.org/cdi/spec/1.1/cdi-spec.html#bm_obtain_unmanaged_instance)
- Add CDI allowing easy accesss to the current CDI container (see http://docs.jboss.org/cdi/spec/1.1/cdi-spec.html#provider)
- Add AfterTypeDiscovery event, allowing extensions to register additional types after type discovery (see http://docs.jboss.org/cdi/spec/1.1/cdi-spec.html#atd)
- Add @WithAnnotations as a way of improving extension loading performance (see http://docs.jboss.org/cdi/spec/1.1/cdi-spec.html#pat)
- Many minor improvements to portable extensions (see http://docs.jboss.org/cdi/spec/1.1/cdi-spec.html#spi)
Try it out and find out more
- Weld 2 is the reference implementation of CDI 1.1, and is available in WildFly 8 Alpha 1.
- http://cdi-spec.org is the official website of CDI, and contains more on CDI 1.1.