Java Reference
In-Depth Information
After you've created your template manifest, you can provide it to Bundlor using the
-m option, as in the following command:
bundlor.bat -i ..\jars\fancyfoods.department.chocolate_1.0.0.jar
-m ..\templates\
-o ..\out\fancyfoods.chocolate.bundled.jar
Now that you've provided configuration, the manifest generated for your JAR looks as
good as it did before, as shown in the following listing.
Listing 12.7
A configured, generated manifest from Bundlor
Manifest-Version: 1.0
Bundle-Blueprint: OSGI-INF/blueprint/*.xml
Bundle-SymbolicName: fancyfoods.department.chocolate
Tool: Bundlor 1.0.0.RELEASE
Bundle-Version: 1.0.0
Bundle-ManifestVersion: 2
You may have noticed that we spent much less time describing and configuring Bund-
lor than we did bnd. We feel duty bound to tell you that this isn't a sign that Bundlor is
much simpler than bnd. You may remember that you started out with a JAR that was
an OSG i bundle. One of the things that Bundlor does is copy across any headers from
the old JAR that aren't updated by the generation code. This means that other than
the import and export headers all of the headers in your generated manifest are cop-
ied from the original bundle. This even includes the Bundle-ManifestVersion and
Bundle-SymbolicName . If you'd started with an emptier JAR manifest, you would have
found that rather more configuration was required to get Bundlor working as you
want it to.
Having now seen how similar bnd and Bundlor are, it shouldn't be surprising to
find out that other tools, such as Apache Felix's mangen, work in a similar way. Rather
than covering these tools with further examples, we think that armed with the previ-
ous examples and relevant documentation, you should have no problem using any
manifest generation tool you choose.
Now you know how a standard JAR can be converted into an OSG i bundle, over-
coming the significant hurdles that put off many potential users of OSG i. But further
issues are associated with using standard JAR s and other Java technologies in OSG i.
Even though your JAR is now an OSG i bundle, that doesn't mean that the things the
code will try to do are OSG i-friendly!
Common problems for OSGi-unaware libraries
For many people, the problems with OSG i begin and end with correctly building a
bundle manifest. As long as you're correctly able to identify your dependencies, then
typically things work . This is a testament to the simplicity and resilience of the OSG i
model. Unfortunately, there are a number of things that can cause huge problems.
Search WWH ::

Custom Search