On 7/31/06, Burkhardt Renz <[EMAIL PROTECTED]> wrote:
I try to understand the OSGi specification -- and during that
process I have some questions, which may be trivial, but it seems
that they are not explicitly addressed in the specification.
I don't claim that I understand anything, but expect the wizards to step in if I got something wrong.
[1] The resolving process, as described in 3.7 of the spec,
tries to wire bundles according to the constraints given in
the manifests of the bundle. Is this process based _only_
on the declarations in the bundles' manifests?
Yes.
[2] It seems obvious that a bundle may export some package,
that is containted in the bundle. And it can import the
very same package, to allow the substitution of the package.
Can a bundle export a package that it does _not_ contain,
i.e. _reexport_ an imported package?
The framework will only inspect the manifest, and would not know whether the classes are really available in a later stage. However, only one exported package of the same name will be used, so if a bundle imports and exports the same package, the result may either be that;
1. The import is wired to somebody else's export, in which case other bundle's imports will be wired to to the same export.
2. The export becomes the source for all imports, including the bundle's own import, and classes requested would not be available and the loading fails.
[3] An Example:
Bundle0: contains P0, imports P0
Bundle1: exports P0, imports P0
Equinox wires Bundle0 to Bundle1 for P0
The consequence are errors at runtime.
Does the OSGi Specification take for granted, that developers
don't do things like in this example?
"granted"?? Well, just like any specification/system it is expected that you follow it. If you don't then things won't work.
[4] When the framework tries to resolve the dependencies of
a new installed package, does it _recalculate_ the wiring between
bundles that it has already established?
Yes, that is the intent. Equinox 3.2.0 has some bugs in this area. At least the ones I found earlier has been fixed for 3.2.1 and later.
[5] With respect to the uses directive in the Export-Package statement
Richard S. Hall writes in a message in this mailing list:
"Bundle B: Export Package: com.osgi.P1;version=1.0.0;uses:=P2;
For P1 in Bundle B to use P2, Bundle B must either export or import P2,
but in your example above it does neither, so this is not a valid example."
Is the rationale behind that comment, that if P1 uses P2, then P2 has to
be contained in the bundle (and has to be exported) or that this is not the
case (and therefore Bundle B has to import P2)? If yes: why does Richard
say "either...or", could not be both?
It must either be imported or exported or both, and the example didn't, hence invalid.
I would be happy if someone who knows the details could help me.
Hope it helps, and I also hope that BJ, Jeff or Richard correct me if I got it wrong ;o)
Cheers
Niclas
_______________________________________________ osgi-dev mailing list osgi-dev@bundles.osgi.org http://bundles.osgi.org/mailman/listinfo/osgi-dev