Creating OSGi bundlesAdded by IBM on October 5, 2011 | Version 1 (Original)
|This section describes how to create an OSGi bundle. For more detailed information about writing bundles, refer to the OSGi Service Platform Release 4.
This section describes how to create an OSGi bundle. For more detailed information about writing bundles, refer to the OSGi Service Platform Release 4.
BundlesParent topic: Working with OSGi bundles
A bundle is the smallest unit of management for the Framework. Bundles are Java
Archive (JAR) files with a manifest that contains special headers. These headers describe the bundle to the OSGi framework and list the bundle's dependencies, such as the packages and services required by the bundle. Bundles can register services with the OSGi framework that other bundles can use.
Conventions for creating bundles
This section provides some recommended guidelines for creating bundles.
Creating manifest files
Each bundle must contain a manifest file. The bundle's manifest file contains data that the framework needs to correctly install and activate the bundle. Legacy Eclipse bundles can provide some manifest information in their plugin.xml
files, but META-INF/MANIFEST.MF files are the recommended files for Manifest information.
Bundles can use code that is defined within other bundles by declaring the packages as imported packages in the manifest file. Although you can create a bundle that does not rely on any classes other than the Java
base packages, most bundles import code from other bundles or the base runtime class path.