Patrick Forhan wrote:
On Thu, Jan 29, 2009 at 3:10 PM, Richard S. Hall <[email protected]> wrote:
Keep in mind that a normal JAR file is always a bundle, but a bundle is not
always a normal JAR file. If you embed JAR files or native libraries in your
bundle, then you cannot use it as a normal JAR file.
Can you clarify? I assume you mean that osgi is doing a little bit of
magic with respect to embedded JARs and native libraries, so you can't
use those portions straight up. But they are still jar files, with a
jar-manifest, classes where java expects them (except in the embedded
JAR case), and so on.
If you embed JAR files in your bundle (and they are on your
Bundle-ClassPath), then OSGi automatically makes them available to your
bundle for class loading. Putting this bundle on the class path would
result in class loading failures because it would no longer have access
to its required bundle class path elements.
I haven't had a whole lot of luck with plain jar files as bundles,
I'll have to read up in the spec how they are to be treated.
Yeah, you can install a normal JAR file, but it isn't very useful. The
only thing you can really do with it is use Bundle.loadClass(),
Bundle.getResource(), etc. to load stuff out of it.
-> richard
Pat.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]