Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-dev] Use of Require-Bundle in EclipseLink OSGI bundles

Current EclipseLink OSGI bundles use Require-Bundle Manifest entries. Following are the entries by bundle.

From org.eclipse.persisetnce.core.jar

   Require-Bundle: javax.activation;resolution:=optional,javax.mail;resol
    ution:=optional,org.eclipse.persistence.antlr;resolution:=optional,or
    g.eclipse.persistence.asm;resolution:=optional,javax.ejb;resolution:=
    optional,javax.jms;resolution:=optional,javax.resource;resolution:=op
    tional,javax.transaction;resolution:=optional,javax.xml.stream;resolu
    tion:=optional,javax.persistence

From org.eclipse.persisetnce.jpa.jar

   Require-Bundle: org.eclipse.persistence.core;visibility:=reexport,syst
    em.bundle,javax.persistence;bundle-version="1.99.0";visibility:=reexp
    ort,javax.transaction

From org.eclipse.persisetnce.oracle.jar

   Require-Bundle: org.eclipse.persistence.core;visibility:=reexport,java
    x.resource

It is not good practice to use Require-Bundle. The bundles that referred above are not guaranteed to be available in all the environment that EclipseLink runs in. For example (i) system.bundle is not available under Felix. (ii) Various javax.* bundles above are not available under GlassFish. However, the packages that we want to import from those bundles are available under these environment. Using Import-Package instead is a better practice. See [1] and OSGI R4 Spec version 3.13.3 for more details.

We should switch to using Import-Package.

Thanks,
Mitesh

[1] http://www.osgi.org/wiki/uploads/Conference/OSGiBestPractices.pdf, slide 14


Back to the top