SeamFramework.orgCommunity Documentation
A bean archive is a java archive, such as a jar or a Java EE module, that contains
a special marker file:META-INF/bean.xml
.
A bean archive may be deployed in a CDI environment. It enables all CDI features for that bean archive.
A bundle is a Java archive, such as a jar or a folder, that contains some special
OSGi marker headers in its META-INF/Manifest.MF
.
A bundle may be deployed in an OSGi environment. It enables all OSGi features for that bundle.
A bean bundle is a java archive that contains both special marker file
META-INF/bean.xml
and special OSGi marker headers in
itsMETA-INF/Manifest.MF
.
A bean bundle may be deployed in an OSGi environment with CDI-OSGi and then be managed by the CDI-OSGi. It enables both OSGi and CDI features for that bean bundle.
CDI-OSGi aims at simplifying application development in an OSGi environment by providing a more modern, more user-friendly and more simple way to interact with the OSGi Framework.
It addresses the OSGi complexity about services management using CDI specification (JSR-299). Thus it provides a CDI OSGi extension with injection utilities for the OSGi environment. An integration of any CDI implementation, such as Weld, is used. This integration is possible through a well-defined bootstrapping API.
CDI-OSGi is a framework that may be used in an OSGi environment and composed by five bundles.
Weld-OSGi is an integration of Weld in the OSGi environment using CDI-OSGi. It is the exhibit implementation of features exposes by CDI-OSGi APIs.
Weld-OSGi is one of the five bundles composing CDI-OSGi. But it also names the framework CDI-OSGi using this particular CDI integration.
Figure 1.1. The five bundles of CDI-OSGi
The blue part represents the CDI OSGi extension. It is composed of one API bundle and its implementation. It is the core of CDI-OSGi that manages all bean bundles.
Thus the extension API bundle exposes the CDI-OSGi features and the extension bundle enables these features. All interactions with client bundles go through the CDI-OSGi extension part.
The yellow part represents the CDI OSGi integration. It is composed of one API bundle and its implementation. It is how CDI features are provided to CDI-OSGi.
Thus the integration API bundle exposes the requirements of CDI-OSGi in order to run CDI features in OSGi environment and the integration bundle is the implementation of these requirements using a vendor specific CDI implementation (such as Weld).
Weld-OSGi is one of the possible extension bundles. So the extension bundle is commutable to support various CDI implementations.
The fifth bundle is the CDI API. It exposes regular CDI features for all client bundles and exempts the user to load CDI API by himself. It is a third-party API provided for convenience to the user.
User client bean bundles should only know about the extension API bundle and the CDI API bundle because they may import their packages in order to use CDI-OSGi features. They do not need to know the other three bundles.
The extension bundle manages bean bundles transparently. It also implements the extension API and uses the container factory service from the integration bundle.
Integration API bundle should only be known by users who want to provide an alternative integration bundle. This latter provides the CDI compliant containers used by the extension bundle. The CDI-OSGi integration part is only used internally.
CDI-OSGi stays compliant with CDI specifications and uses only standard OSGi mechanisms. Every things it does (or nothing from it) CDI or OGSi can do.
Thereby it is compatible with most of the current frameworks dealing with OSGi service management.
Since this specification covers two different (but linked) pieces of software it is separated into two majors parts :
The CDI-OSGi specifications for core functionality usages and CDI container integration.
The Weld-OSGi specifications for Weld integration into CDI-OSGi.