You can use the OSGi BundleCacheManager MBean to interact
with bundles that are in the bundle cache. The bundle cache is a local
directory that contains bundles that are referenced by OSGi applications,
and have been downloaded from both internal and external repositories.
About this task
The methods for the OSGi BundleCacheManager MBean
interface are documented in the Additional
Application Programming Interfaces (APIs) section of the generated
API documentation.
Some
common tasks for which you might use this MBean are as follows:
Procedure
- Interrogate the state of bundles.
For example:
- Check the state of a specific bundle.
- List the completed downloads.
- List the unsuccessful downloads.
- Check that all bundle downloads are complete before adding
an enterprise bundle archive (EBA) asset to a business-level application.
You can use scripting to import an EBA file as an asset,
then add the EBA asset to a business-level application. However, you
cannot add the asset to the application until all the bundles are
downloaded. Therefore you might want to code your script to call the areAllDownloadsComplete
() method, then wait until the method confirms that all
bundles are downloaded before adding the EBA asset to the business-level
application.
- Resolve an unsuccessful bundle download.
If
a bundle does not download, complete the following steps:
- Fix the cause (for example an incorrect repository address,
or a network failure).
- Use the resetBundleDownload () method
to make the bundle available for download again.
- Use the downloadBundles () method
to retry the download.
- Remove a bundle from the cache manager bundle list.
Note: Before you do this, make sure that no application that
uses this bundle is running.