Updating an OSGi composition unit
If a new OSGi application deployment is available, you 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.
Before you begin
This topic assumes that you have either updated the asset that the composition unit contains, or added a composite bundle as an extension to the composition unit. You do not have to update the composition unit every time you update the asset or add a composite bundle extension. You cannot update the composition unit until all bundle downloads are complete.
You can update an OSGi composition unit by using the administrative console as described in this topic, or by using wsadmin commands as described in Updating an OSGi composition unit by using the editCompUnit command.
About this task
An OSGi composition unit consists of an EBA asset, (optionally) one or more composite bundle extensions, and configuration information for running the asset and composite bundle extensions in a business-level application. The configuration information can include HTTP session management, context roots, virtual hosts, security roles, run-as roles, JNDI mappings for Session enterprise beans, JNDI mappings for EJB references, and web application or Blueprint resource reference bindings for your OSGi application.
This topic describes the specific task of updating an OSGi composition unit.
Procedure
Results
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 you update a bundle that provides only OSGi services to the rest of the application, then only that bundle is restarted. If you 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.
- Declare the enterprise bean in the Export-EJB header in the bundle manifest file of the service bundle, so that the enterprise bean is registered in the OSGi service registry, and use a reference element in the Blueprint XML file of the client bundle to inject and call the enterprise bean; for more information, see References and the Blueprint Container. This procedure is the preferred way to configure the EJB dependency.
- In the client bundle, declare an EJB reference to the target enterprise bean, in either an
@EJB
annotation or a binding XML file, and map the EJB reference to the EJB JNDI name when the application is deployed; for more information, see EJB references [Settings].
Messages relating to any restart operations are written to the WebSphere Application Server SystemOut.log file.