CDI 1.1 focuses on improving CDI 1.0 and CDI 1.2 is a minor update correcting issues in 1.1:
@Priority
annotation@AroundConstruct
lifecycle callback for constructors (see the Java Interceptors Specification 1.2)EventMetadata
(read more) to allow inspection of event metadata@Vetoed
annotation allowing easy programmatic disablement of classes (read more)@TransientReference
allowing instances to be retained only for use within the invoked method or constructor (read more and read more)AlterableContext
allowing bean instances to be explicitly destroyed (read more)beans.xml
to prevent scanning of classes and packages (read more)Unmanaged
allowing easy access to non-contexutal instances of beans (read more)CDI
allowing easy accesss to the current CDI container (read more)AfterTypeDiscovery
event, allowing extensions to register additional types after type discovery (read more)@WithAnnotations
as a way of improving extension loading performance (read more)CDI 3.0 is part of Jakarta EE 9. The Jakarta EE 9 release is source code incompatible with previous releases as the package name has changed from javax.enterprise.* to jakarta.enterprise.*
There were no functional or semantic changes in the specification or APIs.
See the Jakarta Context Dependency Injection 3.0 for more information on the Jakarta release.
CDI 2.0 is part of move of Java EE 8 to Jakarta EE 8. The API and specification remain semantically the same, but references to Java EE and associated technologies have been updated to use Jakarta EE and the related updated names.
The source repositories have moved under the Eclipse EE4J organization to the following repositories:
See the Jakarta Context Dependency Injection 2.0 for more information on the Jakarta release.
CDI 2.0 is part of Java EE 8 but is also the first CDI version that support standalone mode on Java SE.
In this version major enhancements are:
The spec was split into 3 parts to add the support for Java SE.
API to boot CDI in Java SE.
Observers (i.e. events) ordering.
Configurators for major SPI elements
Possibility to configure or veto observer methods.
Make possible to apply interceptor on producers.
Alignment on Java 8 features (streams, lambdas, repeating qualifiers)
Contexts and Dependency Injection for Java EE (CDI) 1.0 was introduced as part of the Java EE 6 platform, and has quickly become one of the most important and popular components of the platform.
CDI defines a powerful set of complementary services that help improve the structure of application code.
A well-defined lifecycle for stateful objects bound to lifecycle contexts, where the set of contexts is extensible
A sophisticated, typesafe dependency injection mechanism, including the ability to select dependencies at either development or deployment time, without verbose configuration
Support for Java EE modularity and the Java EE component architecture?the modular structure of a Java EE application is taken into account when resolving dependencies between Java EE components
Integration with the Unified Expression Language (EL), allowing any contextual object to be used directly within a JSF or JSP page
The ability to decorate injected objects
The ability to associate interceptors to objects via typesafe interceptor bindings
An event notification model
A web conversation context in addition to the three standard web contexts defined by the Java Servlets specification
An SPI allowing portable extensions to integrate cleanly with the container
The latest release of CDI is 3.0. You can download the spec or browse the javadoc.
Contexts and Dependency Injection for Java EE (CDI) 1.0 was introduced as part of the Java EE 6 platform, and has quickly become one of the most important and popular components of the platform.
CDI defines a powerful set of complementary services that help improve the structure of application code.
A well-defined lifecycle for stateful objects bound to lifecycle contexts, where the set of contexts is extensible
A sophisticated, typesafe dependency injection mechanism, including the ability to select dependencies at either development or deployment time, without verbose configuration
Support for Java EE modularity and the Java EE component architecture?the modular structure of a Java EE application is taken into account when resolving dependencies between Java EE components
Integration with the Unified Expression Language (EL), allowing any contextual object to be used directly within a JSF or JSP page
The ability to decorate injected objects
The ability to associate interceptors to objects via typesafe interceptor bindings
An event notification model
A web conversation context in addition to the three standard web contexts defined by the Java Servlets specification
An SPI allowing portable extensions to integrate cleanly with the container
Below is the current list of servers supporting CDI, also listed is the implementation used. Only the last servers major version are listed