Java Reference
In-Depth Information
Repository
provider
Resolver
Figure 7.6 A resolver can make use of one or more repository services via the Environment
to find out what capabilities are available.
When the resolver has finished determining a resolvable set of resources, the reposi-
tory services are no longer needed; however, it would be wasteful to get rid of them. If
you needed the repositories for another resolution, you'd have to rebuild them by
modeling all of the bundles, all over again. Even if you keep the repository services
around for the entire lifetime of the framework, but they only exist in memory, they'll
still have to be rebuilt after every restart.
XML REPOSITORIES
A rather large amount of computational effort is required to generate the model for a
bundle, so after it's been done once, it's preferable to save the information away. It's
clearly even better if this data is saved in a format that's human-readable and freely inter-
changeable. This is why the Repositories Specification includes a standard XML form for
a repository. The following listing shows a small snippet of a serialized repository.
Listing 7.1
An excerpt of a repository XML serialization
<repository
xmlns='http://www.osgi.org/xmlns/repository/v1.0.0'
name='Fancy Foods repository'>
<capability namespace='osgi.identity'>
<attribute name='osgi.identity' value='fancyfoods.api' />
<attribute name='version' type='Version' value='1.0.0'/>
<attribute name='type' value='osgi.bundle' />
</capability>
<capability namespace='osgi.wiring.bundle'>
<attribute name='osgi.wiring.bundle'
value='fancyfoods.api' />
<attribute name='bundle-version' type='Version' value='1.0.0' />
</capability>
<capability namespace='osgi.wiring.package'>
<attribute
name='osgi.wiring.package'
value='fancyfoods.food' />
<attribute
name='version'
type='Version'
Search WWH ::




Custom Search