Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orbit-dev] Question on details of export, import, and requires


> David M Williams

>
> Thanks all for all the clarifications.
>
> I might still import/export the javax.xml bundle, as it _is_ just a bunch
> of interfaces. But think I'll leave the rest the same.
>
> One clarification ... you said to use
> Export-Package: javax.xml.parsers; version="2.0"
> Import-Package: javax.xml.parsers; version="[2.0, 2.0]"
>
> but how is
>
> version="[2.0, 2.0]" different from
> version="2.0"


When you use version="2.0" on an import that means anything >= 2.0.  That is not really what you want.  You want to make sure what you are importing a substitute that is an exact match, down to the qualifier, against what you export.  This way your clients that use require-bundle will at least be able to depend on you for particular versions of a package.

>
> Is it that 2.0.0.qualifier would "fit" in [2.0, 2.0] but not in simply
> "2.0"?


No, actually the opposite.  2.0.0.qualifier will not fit into the range.  If you wanted to allow changes in the qualifier to be substituted in for your own export then you would use a range like [2.0, 2.0.1)

>
>
> And, I didn't ask explicitly ... but should we in Orbit now use "uses"
> when we export a package?
> I think PDE can do this "automatically" now. Seems like I recall some
> issues or limitations with using 'uses' but do not recall. Should we
> encourage everyone to?


PDE has had this option for a couple of releases, but I don't think it does it for you automatically.  I still think you need to tell PDE to calculate the "uses" clause for you.  There are still issues with the "uses" clause and resolution performance when dealing with very large installs (1000s of bundles).  We put some safe guards into the OSGi resolver to prevent it from running for long periods of time when a solution can not be found in a reasonable amount of time.  But this just means we will give up sooner and potentially fail to resolve a bundle when there is a valid solution available.  At this point I don't think we should be adding the "uses" clauses into all the orbit bundles.

Tom.


Back to the top