Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[orbit-dev] Bundle packaging question: best practice for importing packages potentially provided by a JDK

Hi everyone,

I am struggling with the best practices for importing packages
provided by a JDK and an execution profile: javax.*, org.xml.sax,
org.w3c etc.

Until now I was simply omitting them and thanks to the bootdelegation
of equinox everything would work fine:
http://wiki.eclipse.org/Equinox_Boot_Delegation
Not importing those packages explicitly would obviously avoid any kind
of package conflict detection: my bundles would work fine with other
bundles that choose to import those packages regardless of the
constraints they would declare.

When we strictly follow the OSGi spec we must turn off the
bootdelegation and import those packages.
For example: https://bugs.eclipse.org/bugs/show_bug.cgi?id=317007

Is this something that in general the orbit bundles should strive to support ?

If we are supporting this situation: how should we import the jdk packages?
With a version or without?

In my opinion we should import them without version.

In those cases where we need in fact to import a more modern version
of the package than what the jdk potentially provides we should use
another bundle that is a fragment to the system bundle and "extends"
the system bundles in that manner.

For example that is what javax.transaction does:
Fragment-Host: system.bundle
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: javax.transaction
Export-Package: javax.transaction.xa;version="1.1",
 javax.transaction;version="1.1"


Please let me know,
Hugues


Back to the top