OSGi - Bundles

Bundles

A bundle is a group of Java classes and additional resources equipped with a detailed manifest MANIFEST.MF file on all its contents, as well as additional services needed to give the included group of Java classes more sophisticated behaviors, to the extent of deeming the entire aggregate a component.

Below is an example of a typical MANIFEST.MF file with OSGi Headers:

Bundle-Name: Hello World Bundle-SymbolicName: org.wikipedia.helloworld Bundle-Description: A Hello World bundle Bundle-ManifestVersion: 2 Bundle-Version: 1.0.0 Bundle-Activator: org.wikipedia.Activator Export-Package: org.wikipedia.helloworld;version="1.0.0" Import-Package: org.osgi.framework;version="1.3.0"

The meaning of the contents in the example is as follows:

  • Bundle-Name: Defines a human-readable name for this bundle, Simply assigns a short name to the bundle.
  • Bundle-SymbolicName: The only required header, this entry specifies a unique identifier for a bundle, based on the reverse domain name convention (used also by the java packages).
  • Bundle-Description: A description of the bundle's functionality.
  • Bundle-ManifestVersion: Indicates the OSGi specification to use for reading this bundle.
  • Bundle-Version: Designates a version number to the bundle.
  • Bundle-Activator: Indicates the class name to be invoked once a bundle is activated.
  • Export-Package: Expresses which Java packages contained in a bundle will be made available to the outside world.
  • Import-Package: Indicates which Java packages will be required from the outside world to fulfill the dependencies needed in a bundle.

Read more about this topic:  OSGi

Famous quotes containing the word bundles:

    He bundles every forkful in its place,
    And tags and numbers it for future reference,
    So he can find and easily dislodge it
    In the unloading. Silas does that well.
    He takes it out in bunches like birds’ nests.
    Robert Frost (1874–1963)