
Originally Posted by
gengshg
I wish my word will help.
Sorry, but it didn't 
I will try to explain myself more clearly. I have a ServiceManager that owns a map of IService. I want to add some IService that are declared as osgi services. So how do I modify the declaration of my bean ServiceManager to incorporate those IService, knowing that this ServiceManager takes as an input a map, not a list.
Code:
<osgi:list id="myExternalServices" interface="IService"/>
<bean id="serviceManager" class="Servicemanager">
<property name="services">
<map>
<entry key="aServiceName">
<ref bean="myLocalService" />
</entry>
<!-- how to add the content of myExternalServices to this map ? -->
</map>
</property>
</bean>
I could of course modify my ServiceManager to make him accept a list, but that is a refactoring I want to avoid.
Moreover If I introduce a setServices(List<IService> list) where I put hte elements of this list in my map, my list won't be managed anymore by SpringDM, am I wrong ? (I mean if one of the IService disappear because its bundle is down, my ServiceManager will still refer to that IService)
I hope I managed to explain my problem more clearly...