Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orbit-dev] Status of "uses" directive in Equinox and Orbit bundles

> Thanks, Tom,
>
> The product in which this problem came up is reasonably large (> 1000
> bundles).  Moreover, there are more than a dozen bundles within Batik that
> all "use" each other.  It's a tangled web.  :-)   Perhaps, then, I shall
> try to re-introduce the "uses" in my bundles and beg you for help if I run
> into difficulties.


OK, Please let me know if I can get access to your setup once you have
something available.  I would like to have a look to make sure the situation
has a relatively large and complex number of solution sets which for which
the resolver must select an answer from.  Unfortunately we are dealing
with an NP-Complete problem for which some situations will be solved very
quickly while others can take an exponential amount of time to solve.

>
> I have another question, not quite related.  I have discovered, I think,
> that whereas I can re-export API of a bundle dependency using the
> "visibility=reexport" directive in a Require-Bundle header, it is not
> possible to Export-Package a package that was Import-Packaged in order to
> re-export it (PDE flags it as an erroneous attempt to export a package not
> defined in the bundle).  Is there a way to re-export packages obtained via
> Import-Package?


No, you cannot reexport packages you get from Import-Package and I really do
not like the visibility=reexport approach either.  To me this is just a way
to make our clients very lazy in their constraint definitions.  Just because
someone requires you does not always mean that they will need access to some
bundle you require.  The visibility=reexport option only makes the
transitive closure of your dependency graph that much more complex.  It
becomes much more difficult to look at a bundle's manifest and see where it
gets its external classes from.

OSGi does allow you to "reexport" a package from one of your required bundles
though.  For example, suppose bundle A required bundle B and bundle B exports
the b.foo.bar package along with a whole bunch of other b.* packages.  In
A would like reexport the b.foo.bar package to other bundles that require
bundle A but not all the other b.* packages.  In this case you would use the
following in bundle A

Bundle-Symbolic-Name: A
Require-Bundle: B
Export-Package: b.foo.bar

This is perfectly ok in OSGi, but I expect PDE will flag a warning/error that
you are exporting a package not included in your bundle.  You can safely
ignore this error/warning.  Personally I do not really mind the error though
because I really do not think reexporting packages or required bundles is a
good thing :)  To me all clients should clearly define their requirements and
additional requirements should not be induced on a client through a constraint
on a bundle (i.e. Require-Bundle).

>
> Thanks for your help!
>
> Christian
>
>
>
>
> Christian W. Damus
> Component Lead, Eclipse OCL and EMF MQ/MT/VF
> IBM Rational Sofware
>
>


Back to the top