Hi,
On 25.05.2009, at 18:13, Vrignaud Etienne wrote:
Hi,
Thanks for the annotation support.
You're welcome
I don't understand very well why you are speaking about using the
"filter"
parameter of the @Requires annotation.
For me it's not clear if this filter is necessary in the Xml syntax
case.
If it's the case, I don't understand why it's mandatory.
In Felix the "Link" between two bundles is done by the import-package
directive that is in the Manifest file.
In that section you can specify the version number of the imported
package.
My point of view is that specifying the version of the dependencies
inside
the Java code is not a good practice.
For my project I cannot do that. The maven pom is here for that.
Well, I definitely agree.
Here is the issue:
When you/iPOJO call getServiceReferences the framework should returns
only "accessible" services. "Accessible" means that you (the bundle)
can access to the service object in term of class loading. So, it
generally means : must use the same service interface class as the
provider (that's why providers and consumers should import the same
package).
So, let's back to getServiceReferences. iPOJO as all the other OSGi
bundle, relies on it and make the assumption that resulting service
objects can be used by the bundle.
However, in your case, it's a little more tricky.
You have two "class" spaces:
- the space V1 containing the api v1 classes
- the space V2 containing the api v2 classes
Your manifest are correct and set correctly the import package range:
so V1 bundles import/ export api [1.0.0,1.0.0] and V2 bundles import/
export api [2.0.0,2.0.0].
So, if we follow the "Accessible" rules, V2 bundles cannot get
services exported by V1 bundles (and V1 bundles cannot access to
services exported by V2 bundles).
but (there is always a but), when a V2 bundles ask for service it
receives services from V2 bundles, and from V1 bundles... Why? just
because it sounds tricky to detect accessible services when using OSGi
Service Factories (used by iPOJO to achieve the laziness) .
So, I don't have any good solution to turn around this issue. In fact,
I don't know if there is one (if somebody has one, feel free to
mention it ;-))
Regards,
Clement
Regards,
/Etienne
--
View this message in context:
http://www.nabble.com/iPojo---How-to-create-several-instances-of-the-same-component-installed-in-different-versions-tp23544877p23709441.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]