[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Resolver Problem with guava and e4 (javax.annotation)

That being said, is it not possible to provide a system fragment bundle which attempts to correct that?:

Fragment-Host: system.bundle
Bundle-RequiredExecutionEnvironment: ?java8[profile]?
Export-Package: javax.annotation;version=1.2,javax.blah;version=x.y.z,..

If we could to that, then a fragment bundle specific per java version could come along and correct all the packages exported by the system bundle without having to modify the impl.



On Fri, Jul 11, 2014 at 7:49 AM, Thomas Watson <tjwatson@xxxxxxxxxx> wrote:

One clarification on import/export. ÂIf your bundle X is a "container" bundle as BJ describes and it imports/exports the packages AND its imports resolve to another bundle then the bundle is effectively "empty" as BJ describes. ÂBut there is one important thing to note about such an empty bundle: ÂOther bundles that happen to require bundle X will now "wire" to the substituted packages that bundle X wires to which replaced/substituted the packages declared to be exported by bundle X.

The other thing to note about this scenario that involves system packages. ÂThe framework *still* does not know what version to export the packages included in the VM. ÂFor example, the javax.annotation packages below. ÂI imagine (but don't know for certain) that the javax.annotation packages include in java 8 would be at version 1.2 or higher, but the framework does not know that so it just exports them at version 0.0.0. ÂSo even though you import/export at version 1.2.0 the package still will not be substituted with the VM package on Java 8. ÂSo we will end up with two exporters of the annotations package.

Tom



Inactive hide details for BJ Hargrave---07/11/2014 09:28:17 AM---Importing what you export is only useful when the bundle contaBJ Hargrave---07/11/2014 09:28:17 AM---Importing what you export is only useful when the bundle contains other Âpackages which actually use

From: BJ Hargrave/Austin/IBM@IBMUS
To: Equinox development mailing list <equinox-dev@xxxxxxxxxxx>
Date: 07/11/2014 09:28 AM


Subject: Re: [equinox-dev] Resolver Problem with guava and e4 (javax.annotation)
Sent by: equinox-dev-bounces@xxxxxxxxxxx




Importing what you export is only useful when the bundle contains other packages which actually use the exported package. For example, a bundle implements the OSGi Event Admin service. That bundle can export the org.osgi.service.event package and also import it. The bundle is happy to use any (version matching) org.osgi.service.event package.Â

But if the bundle is just a "container" of packages which it exports for other and does not itself use the packages in anyway, then there is less value in also importing the packages. Say a bundle just contains the org.osgi.service.event package and exports it as well as imports it. If this bundle is resolved to import the package, the bundle is essentially empty. It is not exporting the package and has no other packages.
Â

I don't know the make up of the bundles in question here. But is may or may not make sense to import the packages being exported. What the bundle contains will influence the choice. That being said, there is little harm in also importing the packages, so it is a safe (but perhaps of little value) choice.
Â
--





From: Â Â Â Â
Andreas Sewe <andreas.sewe@xxxxxxxxxxxxxx>Â
To: Â Â Â Â
equinox-dev@xxxxxxxxxxx, orbit-dev@xxxxxxxxxxxÂ
Date: Â Â Â Â
2014/07/11 04:38Â
Subject: Â Â Â Â
Re: [equinox-dev] Resolver Problem with guava and e4 Â Â Â Â(javax.annotation)Â
Sent by: Â Â Â Â
equinox-dev-bounces@xxxxxxxxxxxÂ




David M Williams wrote:
> I notice in Orbit, all our "javax.annotation" bundles follow the import
> what you export pattern .... that's good, such as
>
> *Export-Package*: javax.annotation;/version/="1.2.0",
> Âjavax.annotation.security;/version/="1.2.0",
> Âjavax.annotation.sql;/version/="1.2.0"
> *Import-Package*: javax.annotation;/version/="1.2.0",
> Âjavax.annotation.security;/version/="1.2.0",
> Âjavax.annotation.sql;/version/="1.2.0"

Is this "import what you export" best practice for *all* javax.* bundles
in Orbit? As far as I can see, some of them don't follow this policy
(javax.xml.bind, for example, whose packages are also provided by the
system bundle provides at least from Java 7 onwards) and I am wondering
whether it's worth opening bugs for this.

Best wishes,

Andreas

--
Codetrails GmbH
The knowledge transfer company

Robert-Bosch-Str. 7, 64293 Darmstadt
Phone: +49-6151-276-7092
Mobile: +49-170-811-3791

http://www.codetrails.com/

Managing Director: Dr. Marcel Bruch
Handelsregister: Darmstadt HRB 91940
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

https://dev.eclipse.org/mailman/listinfo/equinox-dev

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev


_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev



--
Raymond AugÃÂ(@rotty3000)
Senior Software Architect
Liferay, Inc.Â(@Liferay)

GIF image