Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Help find documentation - Export-Package: split
Help find documentation - Export-Package: split [message #90138] Mon, 11 June 2007 15:15 Go to next message
ilan klein is currently offline ilan kleinFriend
Messages: 20
Registered: July 2009
Junior Member
Hi all,

I asked a questinon in the platform newsgroup, and they mentioned I should
come and ask about it here.

The problem was how to tell eclipse that I want to share the same packe from
2 separate plugins.
This is similar to this question here:
http://www.eclipsezone.com/eclipse/forums/t96309.html

The problem was that I have an interface pluginand an implementation plugin.
Both export the same package structure - "pluginone".

There is a user plugin which uses them with "Import Package:" statement.
The answer was to use - Export-Package: pluginone; common="split";
mandatory:="common"

I have attached 3 plugins for showing the problem and solution, now I need
to undersatnd what the change means.

Can you point me to the Export-Paxkage documentation showing the split, and
common ... since I was not able to find it.

Thanks.



Re: Help find documentation - Export-Package: split [message #90330 is a reply to message #90138] Tue, 12 June 2007 13:04 Go to previous messageGo to next message
Brett Humphreys is currently offline Brett HumphreysFriend
Messages: 17
Registered: July 2009
Junior Member
Ilan,

I would suggest reading the OSGi R4 spec (which you can request to
download from www.osgi.org), it goes into detail about what the
mandatory directive does and how it is used.

That being said, I was under the impression that when you have a split
package like you do (similar to the equinox common bundle, which is
split for legacy reasons I believe), you must use the 'require-bundle'
header and not the 'import-package' header. Section 3.13.2 of the R4
spec discusses this a bit, as well as the disadvantages of using this
header.


-Brett


Ilan Klein wrote:
> Hi all,
>
> I asked a questinon in the platform newsgroup, and they mentioned I should
> come and ask about it here.
>
> The problem was how to tell eclipse that I want to share the same packe from
> 2 separate plugins.
> This is similar to this question here:
> http://www.eclipsezone.com/eclipse/forums/t96309.html
>
> The problem was that I have an interface pluginand an implementation plugin.
> Both export the same package structure - "pluginone".
>
> There is a user plugin which uses them with "Import Package:" statement.
> The answer was to use - Export-Package: pluginone; common="split";
> mandatory:="common"
>
> I have attached 3 plugins for showing the problem and solution, now I need
> to undersatnd what the change means.
>
> Can you point me to the Export-Paxkage documentation showing the split, and
> common ... since I was not able to find it.
>
> Thanks.
>
>
>
Re: Help find documentation - Export-Package: split [message #90493 is a reply to message #90330] Wed, 13 June 2007 19:03 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
For a good example look at the following bundles in the Eclipse SDK


org.eclipse.equinox.common
org.eclipse.equinox.registry
org.eclipse.core.runtime

They contain the following exports

Bundle-SymbolicName: org.eclipse.equinox.common
Export-Package: org.eclipse.core.runtime;
common="split";
mandatory:="common"

Bundle-SymbolicName: org.eclipse.equinox.registry
Export-Package: org.eclipse.core.runtime;
registry="split";
mandatory:="registry",
Require-Bundle: org.eclipse.equinox.common

Bundle-SymbolicName: org.eclipse.core.runtime
Export-Package: org.eclipse.core.runtime
Require-Bundle: org.eclipse.equinox.common, org.eclipse.equinox.registry


In this case it was decided to split the org.eclipse.core.runtime
package across 3 bundles. A set of "common" classes from the package
were placed in the bundle org.eclipse.equinox.common, a set of
"registry" related classes were placed in the bundle
org.eclipse.equinox.registry and the rest remained in the bundle
org.eclipse.core.runtime

The mandatory directive was used to force importers of the
org.eclipse.core.runtime package to make a explicit choose to get wired
to a "partial" part of the split package. Require-Bundle is used by the
org.eclipse.core.runtime and org.eclipse.equinox.registry bundles in
order to combined parts of the split package and export the parts
together as on package. For example:

Import-Package: org.eclipse.core.runtime; common="split"

Will wire your bundle to only the part exported by the
org.eclipse.equinox.common bundle.

Import-Package: org.eclipse.core.runtime; registry="split"

Will wire your bundle to only the part exported by the
org.eclipse.equinox.registry bundle, but in this case the registry
bundle uses Require-Bundle to combined the content from the common
bundle into the export from the registry bundle. So your bundle will
have access to both the content from registry and common.

Import-Package: org.eclipse.core.runtime

This cannot wire to the export from common or registry because it does
not use the mandatory attr required to wire to either of these packages.
This will wire your bundle to the part exported by the
org.eclipse.core.runtime bundle. The runtime bundle combines the parts
from common and registry and exports the "complete" package as it was
before the package was split.

HTH

Tom.
Re: Help find documentation - Export-Package: split [message #90597 is a reply to message #90138] Wed, 13 June 2007 20:44 Go to previous message
Eclipse UserFriend
Originally posted by: alex_blewitt.yahoo.com

I put some documentation on this here:

http://www.eclipsezone.com/eclipse/forums/t97259.html

As well as answering in the original thread :-)

Alex.
Previous Topic:Error on "Starting Eclipse Commandline With Equinox Launcher" web page
Next Topic:Access EJB in JBOSS from OSGI
Goto Forum:
  


Current Time: Wed Jan 15 11:35:08 GMT 2025

Powered by FUDForum. Page generated in 0.07472 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top