Network Deployment (Distributed operating systems), v8.0 > Administer applications and their environment > Administer OSGi applications > Maintain an OSGi composition unit > Add or removing extensions for an OSGi composition unit


Add or removing extensions for an OSGi composition unit using wsadmin

Use the addOSGiExtension or addOSGiExtensions command to add composite bundle extensions to a composition unit that contains an enterprise OSGi application. Similarly, use the removeOSGiExtension or removeOSGiExtensions command to remove composite bundle extensions. Use the listOSGiExtensions command to list all the extensions that are currently added to the composition unit.


Before you begin

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

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


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 we 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.

We 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.


Procedure

  1. Optional: List composite bundle extensions.

    Use the listOSGiExtensions command to list the symbolic names and versions of all the extensions that are currently added to a composition unit.

    AdminTask.listOSGiExtensions('-cuName cu_name')
    

    The output from the listOSGiExtensions command is formatted so that you can copy the list of extensions, then paste them into the removeOSGiExtensions command.

    For more information, see listOSGiExtensions command.

  2. Add or remove composite bundle extensions.

    • Add one or more composite bundles as extensions to a composition unit.

      Use the addOSGiExtension or addOSGiExtensions command:

      AdminTask.addOSGiExtension('
        -cuName cu_name
        -symbolicName cba_symbolic_name
        -version cba_version
      ')
      
      AdminTask.addOSGiExtensions([
        '-cuName', 'cu_name',
        '-extensions',
          'cba1_symbolic_name;cba1_version
           cba2_symbolic_name;cba2_version
           cba3_symbolic_name;cba3_version
          '
      ])
      

      The composite bundle must be available in the internal bundle repository, or in an external repository that can process composite bundles.

      To find out what extensions are available for you to add to a composition unit, use the listAvailableOSGiExtensions command:

      AdminTask.listAvailableOSGiExtensions('-cuName cu_name')
      

      For more information, see addOSGiExtension command, addOSGiExtensions command, and listAvailableOSGiExtensions command.

    • Remove one or more composite bundle extensions from a composition unit.

      Use the removeOSGiExtension or removeOSGiExtensions command:

      AdminTask.removeOSGiExtension('
        -cuName cu_name
        -symbolicName cba_symbolic_name
        -version cba_version
      ')
      
      AdminTask.removeOSGiExtensions([
        '-cuName', 'cu_name',
        '-extensions',
          'cba1_symbolic_name;cba1_version
           cba2_symbolic_name;cba2_version
           cba3_symbolic_name;cba3_version
          '
      ])
      

      The output from the listOSGiExtensions command is formatted so that you can copy the list of extensions, then paste them into the removeOSGiExtensions command.

      For more information, see removeOSGiExtension command or removeOSGiExtensions command.

  3. Save your changes to the master configuration.

    To save the configuration changes, use the following command:

    AdminConfig.save() 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 Check the update status of an OSGi composition unit.


Subtopics

Parent topic: Add or removing extensions for an OSGi composition unit

Related concepts:

About OSGi Applications
Composite bundles

Related tasks:

Secure OSGi Applications

Related reference:

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