Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Different Amount of Exported Packages
Different Amount of Exported Packages [message #646988] Mon, 03 January 2011 20:28 Go to next message
Helge Mising name is currently offline Helge Mising nameFriend
Messages: 17
Registered: October 2010
Junior Member
Hi all,

I do not find an answer for my question in the osgi/equinox book ( http://www.amazon.com/OSGi-Equinox-Creating-Modular-Systems/ dp/0321585712) and hope that one of you could point me to the right direction.

I am a little confused of why there may be different amounts of exported packages in a manifest file and in the exported packages one receives when querying the platform with something like:
BundleDescription[] bundleDescriptions = Platform.getPlatformAdmin().getState(false).getBundles();
ExportPackageDescription[] exportedPkgs = bundleDescriptions[0].getExportPackages();


As an example: In a fresh eclipse Helios (version: 3.6.1, build id: M20100909-0800), the first bundle I examine is org.eclipse.osgi (version: 3.6.1.R36x_v20100806). The corresponding manifest file exports 57 packages, whereas the array (exportedPkgs) in the code above contains 301 elements. First the 57 that are declared in the manifest file followed by packages like org.omg.*, org.w3c.dom*, org.xml.sax* (the asterisk abbreviates multilpe package names).
Where do these exported packages come from? Do they come from the libraries that are on the classpath? More important, how can I query the platform to return only the exported packages that are declared via the corresponding section in the manifest file?

Best,
Helge
Re: Different Amount of Exported Packages [message #647072 is a reply to message #646988] Tue, 04 January 2011 13:37 Go to previous message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
In Equinox the org.eclipse.osgi bundle is the system bundle. In OSGi the system bundle represents the framework. The framework is responsible for exporting non java.* packages which are available from the running execution environment (e.g. JavaSE 1.5 vs. JavaSE 1.6 etc). This is why you see the extra package exported by this bundle which are not declared by the org.eclipse.osgi manifest file. The framework determines what execution environment you are running on and exports a predefined list of packages it knows are available for the execution environment you are running on.

The system bundle (org.eclipse.osgi) is the only bundle that has this behavior. All other bundles will export the packages they declare in their manifests. There is no API for determining the packages exported by the system bundle which come from the execution environment. The code inorg.eclipse.osgi.internal.resolver.StateHelperImpl.isSyste mExport(ExportPackageDescription, int) shows code that uses an internal directive for determining this.

HTH

Tom
Previous Topic:Dropins configuration
Next Topic:Handling multiple Eclipse Installations
Goto Forum:
  


Current Time: Fri Apr 26 14:12:31 GMT 2024

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

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

Back to the top