Adding or removing extensions for an OSGi composition unit using wsadmin commands
Use the addOSGiExtension or addOSGiExtensions command to add composite bundle extensions to a composition unit containing 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.
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.
Manage extensions for a composition unit by using wsadmin commands as described in this topic, or using the administrative console as described in Add or removing extensions for an OSGi composition unit.
After you import the enterprise bundle archive (EBA) file for the OSGi application as an asset, we can update versions of existing bundles but we cannot add extra bundles to the asset. However, after we have added the asset as a composition unit to a business-level application, we 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.
- 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 we can copy the list of extensions, then paste them into the removeOSGiExtensions command.
For more information, see listOSGiExtensions command.
- 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 we can copy the list of extensions, then paste them into the removeOSGiExtensions command.
For more information, see removeOSGiExtension command or removeOSGiExtensions command.
- Save the changes to the master configuration.
To save the configuration changes, use the following command:
AdminConfig.save() If we extended a deployed OSGi application, the composite bundle, including its constituent bundles, is downloaded.
What to do next
If we 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.
Subtopics
- addOSGiExtension command
Use the addOSGiExtension command to add a composite bundle as an extension to a composition unit.
- removeOSGiExtension command
Use the removeOSGiExtension command to remove a composite bundle extension from a composition unit.
- addOSGiExtensions command
Use the addOSGiExtensions command to add several composite bundles as extensions to a composition unit.
- listOSGiExtensions command
Use the listOSGiExtensions command to list the symbolic names and versions of all the extensions that are currently added to a composition unit.
- listAvailableOSGiExtensions command
Use the listAvailableOSGiExtensions command to list the symbolic names and versions of all the extensions that are available to be added to a specified composition unit. The command returns all those extensions that are available from a bundle repository, but that have not yet been deployed as an extension to the composition unit.
- removeOSGiExtensions command
Use the removeOSGiExtensions command to remove several composite bundle extensions from a composition unit.
Parent topic: Add or removing extensions for an OSGi composition unit
Related concepts
Composite bundles
Related information:
Add extensions [Collection] Add extensions [Settings] Extensions for this composition unit [Collection] Extensions for this composition unit [Settings]