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 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 wsadmin commands as described in this
topic, or by using the administrative console as described in Adding 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 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.
Procedure
- 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')
Note: 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.
-
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 addOSGiExtensions 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
'
])
Note: 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.
-
Save your changes to the configuration repository.
To save your 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 Checking the update status of an OSGi composition unit.