Extending a deployed OSGi application
A composite bundle groups shared bundles together into aggregates. By adding one or more composite bundles to the composition unit, we can extend a business-level application without having to redevelop and redeploy the underlying OSGi application.
To add or remove composite bundle extensions for a deployed application, use this task. To update bundles and composite bundles that are specified in an EBA asset, see Update bundle versions in a deployed OSGi application.
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. The composition unit also contains configuration information for running the bundles in a business-level application, and when we add composite bundle extensions you might also have to make configuration changes to the composition unit.
No changes are made to the business-level application until you update the composition unit to the latest deployment and save the changes. If the business-level application is running, the bundle and configuration updates are applied immediately.
- Develop the composite bundle.
You use OSGi application tooling to develop the bundles and create the composite bundle manifest. You package the directly-contained bundles and the composite bundle manifest as a compressed archive file with a .cba file extension, then add the .cba file and any referenced bundles to the internal bundle repository.
- Add the composite bundle as an extension to the composition unit.
Use either of the following methods:
- Add the composite bundle extension using the administrative console.
- Add the composite bundle extension using wsadmin commands.
- Optional: Check the update status of the composition unit.
If we plan to update the composition unit at this time, check the update status of the associated OSGi composition unit. This status is one of the following values:
- Use latest OSGi application deployment.
- New OSGi application deployment not yet available because it requires bundles that are still downloading.
- New OSGi application deployment available.
- New OSGi application deployment cannot be applied because bundle downloads have failed.
- Optional: Update the composition unit to the latest deployment.
When all bundle downloads are complete, we can update the OSGi composition unit so that the business-level application uses the newer configuration. You do not have to update the composition unit every time you update the asset or add a composite bundle extension. If any of the updates contain configuration options, you update the configuration information. You can also take the opportunity to make additional, non-essential configuration changes.
Use either of the following methods:
- Update the composition unit using the administrative console.
- Update the composition unit using the editCompUnit command.
When you save the changes to the composition unit, the associated business-level application is updated to use the new configuration. If the business-level application is running, the bundle and configuration updates are applied immediately. If possible (that is, depending on the nature of the updates) the system applies the updates without restarting the application. If we update a bundle that provides only OSGi services to the rest of the application, then only that bundle is restarted. If we update a bundle that provides one or more packages to other bundles, then those bundles and any bundles to which they provide packages are restarted. If, however, a new package or service dependency is added, or an existing package or service dependency is removed, then the application is restarted; a newly added package and service can come from a newly-provisioned bundle, or from a bundle that has already been provisioned.
Subtopics
- Writing extensible OSGi applications
If we are writing an OSGi application that is designed to be extensible, you must ensure that the service references are declared such that only the required bundles are provisioned.
- 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. You can also extend a deployed application by adding one or more composite bundles to the composition unit for the application. You can use OSGi application tooling to develop a composite bundle.
- Add or removing extensions for an OSGi composition unit
Add composite bundle extensions to, or remove them from, a composition unit containing an enterprise OSGi application.
- Checking the update status of an OSGi composition unit
When you change the versions of bundles or composite bundles that an enterprise OSGi application uses, or add or remove a composite bundle extension, the bundles used by the deployed application can get out of synchronization with those bundles that are available. To check that the business-level application is running the most recent version of the EBA asset and any composite bundle extensions, you check the update status of the associated OSGi composition unit.
- Update an OSGi composition unit
If a new OSGi application deployment is available, we can update the OSGi composition unit so that the business-level application uses the newer configuration. If any of the updates contain configuration options, a wizard prompts you to update the configuration information.
Related concepts
Composite bundles
Related tasks
Debugging bundles at run time
Related information:
Add extensions [Collection] Add extensions [Settings] Extensions for this composition unit [Collection] Extensions for this composition unit [Settings]