Java Reference
In-Depth Information
Export-Package: fancyfoods.a; version=1.2.0
Bundle-SymbolicName: B
Bundle-Version: 1.0.0
Export-Package: fancyfoods.pkg; version=1.1; foo=bar; type=old
Bundle-SymbolicName: B
Bundle-Version: 1.1.0
Export-Package: fancyfoods.pkg; version=1.2; foo=bar; type=new;
mandatory:="foo,type"
Example repository
Bundle A
Bundle-SymbolicName: A
Bundle-V ersion: 1.0.0
Import-Package: fancyfoods.pkg;
version="[1,2)"; foo=bar
Export-Package: fancyfoods.a;
version=1.2.0
Bundle B
Bundle-SymbolicName: B
Bundle-Version: 1.1.0
Export-Package: fancyfoods.pkg;
version=1.2; foo=bar; type=new;
mandatory:="foo,type"
Bundle B
Bundle-SymbolicName: B
Bundle-Version: 1.0.0
Export-Package: fancyfoods.pkg;
version=1.1; foo=bar; type=old
Figure 7.7 Your example repository contains three bundles with a variety of package exports, versions,
attributes, and directives.
Given the content of your repository, you'll try to resolve the following bundle:
Bundle-SymbolicName: Test
Bundle-Version: 1.0.0
Import-Package: fancyfoods.a; version="[1.1,2)",
fancyfoods.z; version="[1,2)"; resolution:=optional
If you ask the resolver whether your test bundle can resolve, the following things will
happen under the hood (we've represented the resolution logic as a flowchart in fig-
ure 7.8):
The resolver will model the Test bundle, determining that it has two depen-
dencies: one for the fancyfoods.a package, and one for the fancyfoods.z
package.
1
Having determined that the requirements can't be satisfied by any other bun-
dles known to the resolver (because there aren't any!), the resolver asks the
environment if there are any resources that can supply a package capability for
fancyfoods.a between versions 1.1 and 2. The environment has no matches
locally (because there are no other bundles) and so delegates to the repository.
2
The repository returns the resource A as a possibility, which the resolver deter-
mines to be a valid match, but requiring further dependencies. To determine
whether these dependencies can be satisfied, the resolver asks the environment
if there are any resources that can supply a package capability for fancyfoods.pkg
between versions 1 and 2 that also specify the attribute foo with a value of bar .
3
Search WWH ::




Custom Search