+

Search Tips   |   Advanced Search

Develop a composite bundle

A composite bundle groups shared bundles together into aggregates. It provides one or more packages at specific versions to an OSGi application. We can also extend a deployed application by adding one or more composite bundles to the composition unit for the application. Use OSGi application tooling to develop a composite bundle.

When we want to ensure consistent behavior from a set of shared bundles in an OSGi application, we use a composite bundle to provide that set of bundles to the application. If a required package or service is available at the same version from both a bundle and a composite bundle, the provisioning process selects the package or service from the composite bundle.

When we want to extend a deployed business-level application containing an OSGi application, and we do not want to stop the application or modify the underlying EBA asset, we add one or more composite bundles to the composition unit.

A composite bundle is packaged as a composite bundle archive (CBA) file. This file is a compressed archive file with a .cba file extension. If the composite bundle is part of an enterprise OSGi application, the CBA file can be directly contained within the enterprise bundle archive (EBA) file for the application, or pulled in by reference from the internal bundle repository or from an external repository that can process composite bundles. A composite bundle can directly contain bundles in its CBA file. It can also include by reference bundles that are hosted alongside the CBA file within the same EBA file, or bundles installed in the same bundle repository.

A composite bundle is described in a composite bundle manifest file, META-INF/COMPOSITEBUNDLE.MF. This manifest file lists the OSGi bundles that are directly contained in the composite bundle, and the reference bundles that are hosted alongside the composite bundle in the same EBA file, or in the same bundle repository.

To use your composite bundle to extend a deployed application, install the CBA file in the internal bundle repository or in an external repository that can process composite bundles. If we install a composite bundle in a bundle repository, and the composite bundle includes bundles by reference, ensure that the referenced bundles are also available in the same repository. If we use the internal bundle repository, and the composite bundle directly contains bundles, the contained bundles are not listed separately and are only available as part of the composite bundle. For more information, see Composite bundles.

Rational Application Developer v8.5 provides graphical support for creating and packaging composite bundles. We can also use other tools.


Tasks

  1. Develop the bundles.

    See Create a service bundle and Create a client bundle. We might also want to explore the sample OSGi applications.

  2. Create the composite bundle manifest.

    Most OSGi application tooling, including IBM Rational Application Developer Version 8, helps we create the composite bundle manifest. See also Example: OSGi composite bundle manifest file.

  3. Package the directly-contained bundles and the composite bundle manifest as a compressed file with a .cba file extension.

    The file extension must be.cba, but the composite bundle name need not include "cba".

  4. Check that all referenced bundles are available in the EBA file (if the composite bundle is part of an enterprise OSGi application), or in a bundle repository that can process composite bundles (such as the internal bundle repository).

    See Administer bundles in the internal bundle repository or Administer bundles in the internal bundle repository using wsadmin commands.

  5. Add the CBA file to the EBA file or to the bundle repository.


What to do next


Related:

  • Composite bundles
  • Add or removing extensions for an OSGi composition unit
  • Checking the update status of an OSGi composition unit
  • Update an OSGi composition unit
  • Developing an OSGi application
  • Create a service bundle
  • Create a client bundle
  • Create an OSGi application
  • Deploy an OSGi application as a business-level application
  • Modify the configuration of an OSGi composition unit that includes composite bundles using the editCompUnit command
  • Add an EBA asset that includes composite bundles using the addCompUnit command
  • Writing extensible OSGi applications
  • Add extensions [Collection]
  • Add extensions [Settings]
  • Extensions for this composition unit [Collection]
  • Extensions for this composition unit [Settings]




    File name: was2980.html

    prettyPrint();