Adding or removing extensions for an OSGi composition unit

Add composite bundle extensions to, or remove them from, a composition unit that contains an enterprise OSGi application.

Before you begin

This topic assumes that you have developed a composite bundle, and added it to the internal bundle repository or to an external repository that can process composite bundles. See Developing a composite bundle.

You can manage extensions for a composition unit by using the administrative console as described in this topic, or by using wsadmin commands as described in Adding or removing extensions for an OSGi composition unit using wsadmin commands.

About this task

After you import the enterprise bundle archive (EBA) file for your OSGi application as an asset, you can update versions of existing bundles but you cannot add extra bundles to the asset. However, after you have added the asset as a composition unit to a business-level application, you can extend the business-level application by adding one or more composite bundles to the composition unit.

You can add a composite bundle to, or remove it from, a composition unit. To update an extension to one with newer constituent bundles, you remove the composite bundle from the composition unit then add a new version of the composite bundle.

You can also view read-only information about each listed composite bundle.

Procedure

  1. Start the administrative console.
  2. Navigate to Applications > Application Types > Business-level applications > application_name > composition_unit_name > [Additional Properties] Extensions for this composition unit.

    The Extensions for this composition unit [Collection] panel is displayed. This panel lists all the composite bundle extensions that are currently added to this composition unit. To view read-only information about a composite bundle, click the composite bundle name in the list.

  3. Add or remove composite bundle extensions.
    • Add one or more composite bundles as extensions to a composition unit.
      1. In the Extensions for this composition unit [Collection] panel, click Add. The Add extensions [Collection] panel is displayed.

        This panel lists all the composite bundles that are currently available to be added to the composition unit. That is, all composite bundles that are installed in an available bundle repository, and that have not already been added as a composite bundle extension or used by a deployed EBA asset. To view read-only information about a composite bundle, click the composite bundle name in the list.

      2. Select one or more composite bundles to add.
      3. Click Add. The composite bundle is added, and displayed in the list of composite bundle extensions in the Extensions for this composition unit [Collection] form.
    • Remove one or more composite bundle extensions from a composition unit.
      1. In the Extensions for this composition unit [Collection] panel, select one or more composite bundle extensions to remove.
      2. Click Remove. The selected composite bundles are removed, and the updated list of composite bundle extensions is displayed.
      Note: The bundle cache entries for the extension are automatically deleted when the composition unit that was extended is deleted. If you do not delete the composition unit from the business-level application, then the bundle cache is not automatically cleaned up. Repeatedly adding and removing extensions from the same composition unit causes the bundle cache to grow, which can potentially increase application startup time.

      To prevent the bundle cache from growing, you can remove the old extensions from the bundle cache by using the BundleCacheManager MBean. For more information, see Interacting with the OSGi bundle cache.

  4. Save your changes to the configuration repository.
    If you extended a deployed OSGi application, the composite bundle, including its constituent bundles, is downloaded.

What to do next

If you plan to update the composition unit at this time, check that all bundle downloads are complete. See Checking the update status of an OSGi composition unit.