This section describes the provisioning repository feature of SpringSource dm Server, the reasons for using it, and how to configure it.
In most use cases, your application includes dependencies on third-party libraries, such as Spring Framework and Hibernate. You typically express the dependencies between your application and third-party libraries using the Import-Package
or Import-Library
manifest header in the MANIFEST.MF
file of your application.
The Import-Package
header is standard to OSGi; however, Import-Library
is specific to SpringSource dm Server. Some third-party dependencies consist of multiple bundles but are logically one unit. To support this, the SpringSource dm Server introduces the concept of a library. A library is a collection of related bundles that can be referenced as a whole. For additional details about the creation and usage of libraries, as well as general information about dependencies, see Programmer's Guide.
In SpringSource dm Server, you store all third-party dependencies needed by your applications, such as Spring Framework and Hibernate, as valid OSGi bundles in the provisioning repository. SpringSource dm Server supports only dependencies that are valid OSGi bundles.
When you deploy your application, SpringSource dm Server installs the bundle in which it is packaged to the dm Server runtime; part of this internal installation procedure is to satisfy all the application's dependencies. If your application has a dependency that cannot be satisfied from the bundles that you have already deployed (and dm Server has thus installed), the dm Server searches the provisioning repository for a bundle that can satisfy that dependency.
The provisioning repository for a particular instance of SpringSource dm Server can include bundles in the following general locations:
external
directories that adhere to a specified search pattern and are scanned by dm Server just at startup, or watched
directories that point to a single directory location and dm Server scans on a regular basis.
You configure the provisioning repository using the SERVER_HOME/config/repository.properties
file.
As previously implied, a particular instance of SpringSource dm Server can itself also act as a repository host for remote server instances to use when satisfying the dependencies of the applications deployed to it. In this case, you configure a hosted repository using the SERVER_HOME/config/hostedRepository.properties
file. Typically, only remote clients use hosted repositories and their contents; the SpringSource dm Server instance that actually hosts the repository does not typically use the bundles in it. Rather, it uses bundles in its local repository.
Making a third-party dependency available to your application is simply a matter of adding its bundle or library to the appropriate location in the provisioning repository. This could be either in the local directories or the remote ones if you are getting bundles from a remotely-hosted repository.