Network Deployment (Distributed operating systems), v8.0 > Develop and deploying applications > Develop OSGi applications


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. We can use OSGi application tooling to develop a composite bundle.


About this task

When to ensure consistent behavior from a set of shared bundles in an OSGi application, you 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 to extend a deployed business-level application that contains an OSGi application, and you don't want to stop the application or modify the underlying EBA asset, you add one or more composite bundles to the composition unit.

A composite bundle is packaged as a composite bundle archive (CBA) file. This 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 that are 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 you 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 you 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. See Composite bundles.
IBM Rational Application Developer v8 provides graphical support for creating and packaging composite bundles. We can also use other tools.


Procedure

  1. Develop the bundles.

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

  2. Create the composite bundle manifest.

    Most OSGi application tooling, including IBM Rational Application Developer v8, helps you 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.

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


What to do next

Parent topic: Develop OSGi applications

Parent topic: Extend a deployed OSGi application

Related concepts:

About OSGi Applications
Composite bundles

Related tasks:

Add or removing extensions for an OSGi composition unit
Check the update status of an OSGi composition unit
Update an OSGi composition unit
Secure OSGi Applications
Develop and deploying 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

Related reference:

Sample OSGi applications
OSGi Applications: Troubleshooting tips

Related information:

Add extensions [Collection]
Add extensions [Settings]
Manage extensions for this composition unit [Collection]
Manage extensions for this composition unit [Settings]
Task topic Feedback
Copyright IBM Corporation 2009, 2011. All Rights Reserved.
This information center is powered by Eclipse technology.

+

Search Tips   |   Advanced Search