CDI APIs 1.2 API
Contexts and Dependency Injection (CDI) defines a set of complementary services that help improve the structure of application code.
- A well-defined lifecycle for stateful beans bound to well-defined 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, allowing any bean to be used directly within a JSF or JSP page
- The ability to decorate injected beans
- The ability to associate interceptors with beans 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
CDI allows objects to be bound to lifecycle contexts, to be injected, to be associated with interceptors and decorators, and to interact in a loosely coupled fashion by firing and observing events. Various kinds of objects are injectable, including EJB 3 session beans, managed beans, producer methods and Java EE resources. We refer to these objects in general terms as beans and to instances of beans that are bound to contexts as contextual instances.
Packages
Package
Description
Annotations relating to decorators.
Annotations and interfaces relating to scopes and contexts.
The custom context SPI.
Annotations and interfaces relating to events.
Annotations relating to bean and stereotype definition,
built-in qualifiers, and interfaces and classes relating
to programmatic lookup.
The portable extension integration SPI.
Contains shared, general-purpose helper classes and annotations.