Latest Posts

Archives [+]

Categories [+]

Authors [+]

Entries filed under 'bundle'

    Posted by Felix Meschberger JAN 07, 2010

    Posted in bundle, id, location, osgi and symbolic name Comment 1

    Looking at the Bundle details in the Web Console you will notice a number of entries providing information about the bundles. In this article I will explain a bit more about the information regarding the identification of bundles.

    Looking at the following screen dump you will notice a number of identifaction details of a bundle:

    1. The bundle identification number. This is a number uniquely identifying the bundle. This number assigned to the bundle at the installation time of the bundle and never changes. These numbers are also unique within the framework. Never will a bundle ever be assigned the same number, even if the currently installed bundle is uninstalled.
    2. The bundle name. This is a descriptive name of the bundle which is ignored by the OSGi framework. This name is provided by the bundle developer as the contents of the Bundle-Name manifest header.
    3. The bundle symbolic name. This is a symbolic name of the bundle, which is used by the OSGi framework together with the bundle version number to identify the bundle. That is, no two bundles with the same symbolic name and version may be installed in a single OSGi framework. But multiple bundles may be installed which have the same symbolic name but differ in their version number. This symbolic name is provided by the bundle developer as the contents of the Bundle-SymbolicName manifest header.
    4. The bundle version. The version of the bundle is used to convey the development state of the bundle as a whole. Together with the bundle symbolic name the version number must be unique within an OSGi framework (see the description of the bundle symbolic name). Note that the OSGi framework places only synthatic restrictions on version numbers. This version is provided by the bundle developer as the contents of the Bundle-Version manifest header.
    5. The bundle location. The bundle location is basically just a string. It is recommended that this string follows the syntax of an URL and it may even be used as an URL to update the bundle from: The Bundle.update() method uses the bundle location to try to access an updated bundle version. This is not used as such though in Communiqué 5 where the bundle location merely indicates where the bundle has initially been installed from. This value is provided by the administrator as the location parameter when installing the bundle through the BundleContext.installBundle(String location) or BundleContext.installBundle(String location, InputStream input) method. This value will not changed when the bundle is updated.
    6. The last modification time. The last modification time is set by the framework when the bundle is modified. A bundle is modified when it is installed, updated or uninstalled. Starting and stopping the bundle does not change the last modification time. This information can be used to verify that a bundle update has really been executed by the OSGi framework.

    As can be seen a number of identification details are set on installation time and never change afterwards and some details may change over time when a bundle is updated.

    So here are the rules regarding these details:

    • The bundle identification number is assigned by the framework and is never reused.
    • The bundle location is assigned from the location parameter when the bundle is installed and never changes during the existence of the bundle. No two bundles will ever be installed at the same time with the same bundle location. As such this location is also a unique identifier for bundles. But in contrast to the bundle identification number, the location may be "reused". That is, once a bundle with a given location has been uninstalled another bundle may be installed with the same location.
    • The bundle symbolic name and version together also uniquely identify an installed bundle. These values are taken from the bundle manifest and therefore may change when a bundle is updated. But it is not allowed for multiple bundles to be installed with the same symbolic name and version at the same time.

    So, whenever you update a bundle, either placing it into an install folder in the repository or through the Web Console, expect the bundle version and/or symbolic name to change. But both the bundle identification number and the bundle location will not be modified. The bundle last modification time will reflect the time at which the bundle has actually been updated by the framework.