felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall" <he...@ungoverned.org>
Subject Re: [jira] Commented: (FELIXM2-8) Exported Package not found in bundle or JARs on bundle class path (Feature or Bug ?)
Date Tue, 15 Aug 2006 15:57:03 GMT
Hey Jan,

>> As far as I understand the R3 spec, no re-exporting of 
>> package is allowed at all. Page 47 of the R3 spec says, "The 
>> Framework must guarantee that classes and resources in the 
>> exported package's name-space are loaded from the exporting 
>> bundle." 
>>     
>
> Well, this is not a contradiction to reexporting in my understanding, as
> long as the bundle classloader takes care about delegating reexported
> packages to the original exporter. So they are still loaded from the
> exported bundle but the delegation path goes through the reexporting bundle.
> I'm not sure, but maybe this would be okay. 
>   

While I won't argue with your interpretation, since I think it is not an 
unreasonable interpretation of the spec, I will say that I am fairly 
certain that the R3 spec does not entertain the notion of re-exporting. 
The R4 spec specifically does mention re-exporting, but this is only 
allowed when using require-bundle.

Your message caused me to have a discussion with Peter Kriens about this 
topic and he and I are in agreement on this...for whatever that buys 
you. :-)

>> So, I think if KF allows this, then it is incorrect.
>>     
>
> I have had a look at their bundles. In more recent versions, they export a
> higher specification-version number than importing. I recall, there is
> something about it written in the specs. I should look it up ...
>   

Exporting a higher version than what you import is not a way of doing 
re-exporting...in that case the bundle does contain the exported 
package, but the framework may not actually choose to use that export, 
it may choose to wire the bundle to a different bundle for that package.

In R3 every export declaration has an implicit import 
declaration...having an explicit import declaration [for an export] does 
not really make its interpretation any different, it just allows the 
bundle to specify a different version than what is exported. If a bundle 
had an explicit import for the same version of a package that it 
exported, then this would be identical to having no explicit import at 
all for that package (i.e., the same as only exporting it).

The whole point of making exports imply imports in R3 was to allow 
substitutability of packages so that bundles could interoperate. In R4, 
exports do not implicitly imply an import any more, so if you want 
interoperation you must include the import explicitly, which is 
generally a good idea to do for any service interfaces that a bundle 
exports.

The R4 spec clearly states that if a bundle both imports and exports the 
same package, then the framework obeys one and discards the other (see 
section 3.7).

> No, it's fine for the moment. Since the maven plugin is designed for R4, I
> consider it to be a feature and not a bug :-)

Good.  :-)

However, I do think it is correct for R3 too.

-> richard

Mime
View raw message