Java Reference
In-Depth Information
0..n
Repository
files
Repository
0..n
1
refers
contains
0..n
1
1
Resource
requires
provides
0..n
1
Requirement
0..n
Capability
0..n
extends
Figure 10.2 Relationships among
the OBR repository entities
Extend
Using this information, an OBR implementation is able to resolve a consistent set of bun-
dles for deployment given an initial set of bundles to be deployed. OBR 's dependency-
resolution algorithm is basically the same as the framework's dependency-resolution
algorithm.
OBR vs. framework resolution
Although the dependency-resolution algorithms for OBR and the framework are simi-
lar, they aren't identical. OBR starts from a given set of bundles and pulls in resourc-
es from its available repositories in an attempt to satisfy any dependencies. The
framework's resolution algorithm will never pull in additional resources; it only con-
siders installed bundles.
Another gotcha is the fact that the current OBR RFC doesn't currently mandate uses
constraints when resolving dependencies. This can lead to unexpected failures at ex-
ecution time if a uses constraint prevents bundles from resolving. OBR is an active
area of work within the OSGi Alliance, so future revisions of the RFC may address
this issue.
With this overview of OBR , let's look at how you can create a repository for it.
CREATING OBR REPOSITORIES
To i l l u s t r a t e h o w t o c r e a t e a n OBR repository, let's use the bundles from the service-
based paint program example. The repository is just an XML file containing the meta-
data of the bundles. We'll go through the entries in the XML file and explain the
schema along the way. Assume you have the bundles from the example in a directory
called paint-bundles. The directory contains the paint frame bundle, the API bundle,
and the three shape bundles:
 
Search WWH ::




Custom Search