At run time, OSGi applications are isolated from each other, but their dependencies are shared.
For each application server that is running one or more OSGi applications, there is also one shared bundle space.
The primary content of an OSGi application runs in the framework of the application. The dependency bundles and the shared bundles in the application run in the shared bundle space.
When an application is started, the bundles that are listed in the deployment manifest of the application are loaded into the runtime environment. The bundles that are listed in the Deployed-Content header in the deployment manifest are loaded into the isolated framework. The bundles that are listed in the Deployed-Use-Bundle and the Provision-Bundle headers in the deployment manifest are loaded into the shared bundle space.
The dependency bundles in the shared bundle space can originate from the internal bundle repository, the external bundle repository, or the content of the application.
However, shared bundles in an application must be provided by reference rather than contained directly in an application. This is because if shared bundles are contained directly in an application, they are not available to other applications when the applications resolve, but are in the shared bundle space at run time, which might cause problems.
Manifest-Version: 1.0
Application-ManifestVersion: 1.0
Application-Name: Example Blog
Application-SymbolicName: example.blog.app
Application-Version: 1.0
Application-Content:
example.blog.api;version=”[1.0.0,2.0.0)”,
example.blog;version=”[1.0.0,2.0.0)”
Manifest-Version: 1.0
Application-SymbolicName: example.blog.app
Application-Version: 1.0
Deployed-Content:
example.blog.api;deployed-version=1.0.0,
example.blog;deployed-version=1.1.0
Provision-Bundle:
blog.required.bundle;deployed-version=1.2.0
Import-Package: blog.required.package
The blog.required.package package is wired from the blog.required.bundle in the shared bundle space to bundles in both isolated application frameworks, as shown in the following diagram.