Hi folsgaard,
I think what you describe is possible.
You can have Bundle A exposing service A, and using service B; and Bundle B exposing service B and using service A.
This will work if one of the service import is declared as optional, so that, when you deploy the bundles on the platform, the dependency constraints can be resolved.
The spring dm files will look like :
Bundle A file :
Code:
<bean name="A" class="ServiceA">
<property name="b" ref="serviceB">
</bean>
<osgi:reference interface="IServiceB" id="serviceB" cardinality="0..1"/>
<osgi:service interface="IServiceA" ref="A"/>
Bundle B file :
Code:
<bean name="B" class="ServiceB">
<property name="a" ref="serviceA">
</bean>
<osgi:reference interface="IServiceA" id="serviceA"/>
<osgi:service interface="IServiceB" ref="B"/>
In this case, you need to start Bundle A before Bundle B. The reference to service B being optional, bundle A will be able to start, and then, Bundle B will be able to start also (as service A is available).
Hope this helped.
Regards,
Lorie.