On 3/16/10 8:50, lukewpatterson wrote:
Is there a thread/post/blog entry somewhere that explains the terms
"wrap/wrapped/wrapping..." and "embed/embedded/embedding..." as they relate
to making a non-OSGi-aware jar into a bundle?

I guess I'm looking for a mental venn-diagram of how the two concepts relate
and where the subtleties are.

The two can be used to entirely the same thing (i.e., convert a JAR file to a bundle):

   * For wrapping, you simply add OSGi metadata to your normally
     generated JAR file manifest (i.e., you just have one JAR file).
   * For embedding, you create a container JAR file with OSGi metadata
     in its manifest and add the existing JAR file you want to embed
     into the container JAR file and its its location to the
     Bundle-ClassPath (i.e., you have two JAR files, one containing the
     other).

The assumption here is you might not be able to modify an existing JAR file so you embed it rather than wrap it to convert it to a bundle.

However, embedding provides a use case that wrapping cannot, which is having your own private copy. In some cases, you don't want to convert a JAR file into a bundle, you just want to use it inside your bundle. In that case you embed it, add it to your Bundle-ClassPath and don't expose it via Export-Package or whatnot, then it is your bundle's own private library.

-> richard


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to