When an OSGi application is installed as an enterprise bundle archive (EBA) asset, provisioning ensures that all the OSGi bundles that are required for the application to run are available. An OSGi application can use bundles from remote repositories, bundles from the local repository, and bundles that are included in its EBA file.
As an OSGi application becomes formalized, the developer creates an application manifest that lists all the bundles that the application uses directly. Of this set of bundles, the developer might choose to package up only newly-created bundles in the EBA file, expecting other bundles to be provisioned from the configured local and remote repositories.
You cannot use an external bundle repository to provision services. If you want to provision services that are exported by a bundle, you must store that bundle in the internal bundle repository.
Provisioning occurs when the OSGi application is installed as an EBA asset, or when an existing EBA asset is updated. The EBA asset is resolved; that is, the locations of the constituent application bundles, at appropriate versions, are determined by using the contents of the EBA file, the local repository, and the specified set of external bundle repositories. Provisioning also checks for dependencies and locates them from the relevant bundle repositories. Dependencies include imported packages, required bundles, services, and persistence providers. The provisioning process detects service dependencies by checking the <service> and <reference> elements in the Blueprint XML files for a bundle. Bundles are scanned for Blueprint XML files when the bundles are added to the local bundle repository, or when they are provided in an EBA file. If your application code makes direct programmatic use of OSGi services, provisioning does not detect those service dependencies unless they are also specified in the Blueprint XML files.
If a bundle is referenced in the application manifest with a range of possible versions, provisioning locates a bundle at a version in that range. If more than one version of a specified bundle is available, the latest version in the specified range is selected, unless selecting a later version prevents the application from resolving.
If a required package or service is available at the same version from both a bundle and a composite bundle, the provisioning process selects the package or service from the composite bundle.
If the constituent application bundles resolve successfully, when the configuration is saved, all the referenced bundles and dependency bundles are downloaded from either the internal bundle repository or external bundle repositories. The resolved bundles are copied to the appropriate location on the local disk.
When the download is complete, you can add the asset to a business-level application. If you are updating an asset that has already been added to a business-level application, you must restart the business-level application for the updates to take effect.