Hi,

Matthias Neubert schrieb:
> Hello,
> 
> thanks for your reply:
> 
>> BundleA:
>> Import-Package: org.bundleB.ServiceB; version=[1.2.3,1.2.4)
>> Export-Package: net.bundleA.ServiceA
> 
> 
> -> does Bundle  "BundleAImpl" Import then look like this:
>  Import-Package: org.bundleB.ServiceB; version=[1.2.3,1.2.4),
> net.bundleA.ServiceA

No, I don't think so. It suffices it to say version=1.2.3 (or whatever
is appropriate for BundleAImpl). The framework should calculate the
wiring so that versions match.

Of course, if BundleAImpl implements an interface which comes from
BundleB, you will have to take extra care with the bundleB package
import and might even have to specify the same import version restriction.

Regards
Felix

> 
> ?
> 
> This would have the drawback that I have to know for building
> BundleAImpl which version
> is imported by  by BundleA. This is somehow dangerous. I'd like to have
> this automated.
> 
> Is there any possebility to have this automatically?
> 
> regards
> Matthias
> 
> 
> Am 25.09.2009 um 20:29 schrieb Felix Meschberger:
> 
>> Hi,
>>
>> Matthias Neubert schrieb:
>>> Hello,
>>>
>>> this time I have got an question about a best practise regarding Felix
>>> and iPOJO
>>>
>>> BundleA contains only a Package with an Interface, which it exports. It
>>> imports another Package with Interface from Interface-BundleB.(which is
>>> needed for describing BundleA's Interface)
>>>
>>> Exp.:
>>>
>>> BundleB:
>>> Export-Package: org.bundleB.ServiceB
>>>
>>> BundleA:
>>> Import-Package: org.bundleB.ServiceB
>>> Export-Package: net.bundleA.ServiceA
>>>
>>> An Implementation Bundle of BundleA's Interface (BundleAImpl) imports
>>> BundleA's Packages for implementing it, and so also has to import
>>> BundleB's Package:
>>>
>>> BundleAImpl:
>>> Import-Package: org.bundleB.ServiceB, net.bundleA.ServiceA
>>>
>>>
>>> My Intension is, to be shure that the bundles  BundleA and BundleAImpl
>>> allways import the same package from same BundleB (to avoid e.g. version
>>> conflicts)
>>>
>>> My think it must be something like BundleA is reexporting Package of
>>> BundleB and BundleAImpl shuld be forced to import BundleB-Package over
>>> BundleA.
>>>
>>> Question: are there any best practises to achieve this?
>>
>> I would not re-export bundleB package from BundleA. Rather I would tye
>> the version used by BundleA closes to the version exported by BundleB
>> and used by BundleA, e.g.:
>>
>> BundleB:
>> Export-Package: org.bundleB.ServiceB; version=1.2.3
>>
>> BundleA:
>> Import-Package: org.bundleB.ServiceB; version=[1.2.3,1.2.4)
>> Export-Package: net.bundleA.ServiceA
>>
>> I think this should do the trick.
>> Regards
>> Felix
>>
>> ---------------------------------------------------------------------
>> 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]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to