Simply use the ranking attribute; Service in Bundle 1 becomes e.g. ranking 0
and Service in Bundle 2 becomes ranking 10; the moment Bundle 2 pops up this
service will be used instead of the one in Bundle 1;

Example taken from [1]:

<service ref="beanToBeExported" interface="com.xyz.MyServiceInterface"
  ranking="9"/>

http://static.springsource.org/osgi/docs/1.1.x/reference/html/service-registry.html

Kind regards,
Andreas


On Tue, Aug 30, 2011 at 17:10, afilippov <[email protected]>wrote:

> Hi there,
>
> Need some architecture help... Imagine the following situation - I have:
>
> Bundle 1 where service interface and its default implementation are put.
> Bundle 2 that has a reference to Bundle 1 and another implementation class.
>
> Bundle 1 has no reference to the Bundle 2.
>
> I wonder if there are any possibilities to tell which implementation to use
> only by means of config settings?
>
> It is all driven with Spring.
>
> Appreciate.
>
> --
> View this message in context:
> http://servicemix.396122.n5.nabble.com/SMX-osgi-louse-coupling-tp4750392p4750392.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>

Reply via email to