6. OSGI Profiles and Bundlor

When managing and transforming the many bundles included in the SpringSource Enterprise Bundle Repository, it can become difficult to remember which packages are boot delegated, which are exported from the system bundle, and which are from other bundles in your system. This information is important because you typically do not want to import packages into your own application that are boot delegated, you want to import system bundle packages at version 0, and you want to define custom imports for all the rest of the bundles. Trying to keep track of which packages are in each of these categories can be error prone; similarly, defining template entries for them in your manifest template can be time-consuming and tedious.

To solve this problem, you can specify that Bundlor take an Section 6.1, “Overview of OSGI profiles” as input and automatically add template entries for boot delegated packages and system bundles. These import entries would ignore boot-delegated packages and set the version of system bundles to version="0". This feature is available for all Bundlor front ends: command-line, ANT and Maven.

6.1 Overview of OSGI profiles

An OSGi profile defines the packages that a particular OSGI runtime (such as dm Server) exports from the system bundle and the packages that it delegates to the boot class loader. An OSGI profile isn't an actual file; rather, it is two properties that are well known to an OSGi runtime. However, when you pass these properties to Bundlor, you pass them as a file, as described in the next section. The properties that make up an OSGI profile are as follows.

  • The org.osgi.framework.system.packages property defines the packages exported from the system bundle.
  • The org.osgi.framework.bootdelegation property defines the packages that are boot delegated.

If you are using dm Server as your OSGI runtime, see the file DM_SERVER_HOME/lib/java6-server.profile for its OSGI profile, where DM_SERVER_HOME refers to the main installation directory of dm Server. If you are using another OSGI runtime, such as Equinox, then see their documentation for their OSGI profile.

For additional information about the syntax of the values of these properties, see sections 3.8.3 and 3.8.5 of the OSGI specification.