+

Search Tips   |   Advanced Search

Contexts and Dependency Injection (CDI)

Learn about Contexts and Dependency Injection 1.2 for the Java EE platform (CDI 1.2), which is a JSR 346 implementation based on JBoss Weld.

CDI is activated in an application either by the presence of a beans.xml file inside that module, or by bean defining annotations defined in the JSR 346 specification. We can find the beans.xml file in the WEB-INF directory of a web archive (WAR), or META-INF directory of other types of archives. When activated, the container provides services such as:

The specification-related API classes for JSR 299 and JSR 330 and IBM modified implementation classes that are based on Apache OpenWebBeans are packaged with the application server runtime environment.

Although the product CDI implementation is based on Apache OpenWebBeans, the following changes are added to OpenWebBeans to support integration with the server run time:

Important: Container-managed transactions and security are not provided by CDI.

CDI is only supported by the default WAS traditional class loader policy, Class loader for each WAR file in application, and not with the alternative, single class loader for application setting.


Subtopics

  • Troubleshoot contexts and dependency injection
  • Developing applications that use Contexts and Dependency Injection (CDI)
  • Contexts and Dependency Injection (CDI)