Java Reference
In-Depth Information
The bundle plug-in can read an obr.xml file for supplemental information about
requirements and capabilities. For example, if you need to document toffee sauce
requirements, you can handle them with an obr.xml fragment.
Apache Aries also provides a command-line repository building tool that models pack-
age dependencies, but also makes use of the Aries Blueprint implementation to
model Blueprint services and references. The command syntax is as follows:
java -jar
[repository xml location] url1 [url2...]
If you're using Nexus for Maven hosting, Nexus's ability to expose an OBR -compatible
view of the repository can be convenient. This provides an excellent way to share exist-
ing artifacts without impacting existing infrastructure.
As we discussed in section 7.2.2, the ability of these tools to generate repositories that
allow service-based provisioning depends on service metadata being available. For
those of you that don't want to use an injection container, or if you want to describe
nonstandard requirements, all isn't lost! Because there's a standard XML serialization
for OSG i repositories, it's entirely possible to author your own resource descriptions.
You need to be careful to keep the description of your resource up to date if your bun-
dle ever changes, but it does give you all the flexibility you could ever need. You can
also hand decorate the repository descriptions generated by a tool with additional ser-
vice capabilities and requirements as necessary. The schema for the bundle repository
format is available at .
Services should use the osgi.service namespace and objectClass attribute.
You can provision directly against repositories generated using one of these tools, or
you can use one of the repository implementations we discussed in section 7.3 to create
a federated view of your local repository and one or more of the public repositories.
Generating your repository
The Apache Aries repository generation tool processes a set of bundles in a directory,
turning them into an XML repository. To start with, let's put your application bundles
in a directory on disk.
Now that you have a location on disk to scan, you need to get hold of the reposi-
tory generator. The repository generator uses a live OSG i framework to model the
bundles, which ensures that it can validate any extra namespaces used in your Blue-
print bundles. To validate these namespaces, the repository generator also needs the
bundles that provide these extra namespaces.
The Apache Aries modeler is new, and so isn't available as a set of released mod-
ules. To get hold of the application modeler, you can either get one from a nightly
snapshot of the Aries build, or by building Aries yourself. The bundles you need exist
Search WWH ::

Custom Search