SpringDM Managed Service List is not updated with new services [message #986329] |
Mon, 19 November 2012 21:37  |
Eclipse User |
|
|
|
Hi folks.
This is my scenario:
I have a service defined by the Bundle A. Bundle A also haves one implementation of this service.
A Bundle B also register another implementation of the same service.
In the Bundle A, in a component, I need to get all of this services implementations, and I mapped it in this way:
META-INF/spring/bundle-context.xml
<osgi:list id="serviceList" interface="foo.Service" cardinality="0..N"/>
and, I get an reference on the component with a Autowired setter
@Autowired
public void setServiceList(List<Service> services) {...}
My problem is because this list contains always only the Bundle A implementation, even with the bundle B (that starts after Bundle A) register the service with success. I can see the service on the Equinox console, and on server startup logs.
In the spring dm documentation, its clear that this kind of service list will be managed, and when services come and go from the service registry, it will be added or removed from the list. Even if I reinject the list in another component, I always get only the Bundle A implementation.
I'm doing something wrong?
Thanks by help!
|
|
|
Re: SpringDM Managed Service List is not updated with new services [message #987402 is a reply to message #986329] |
Mon, 26 November 2012 08:46  |
Eclipse User |
|
|
|
Hi folks.
I've solved this problem, with a workaround:
In this case, I cannot use annotations to inject the service list.
If I map the Component manually, and then, inject the service list by bean reference, it works. Ive got all implementations. I belive that another list is injected with @Autowire, and not the <osgi:list> that I've mapped.
How can I force the injection of this list, in a Annotated enviroment?
|
|
|
Powered by
FUDForum. Page generated in 0.04092 seconds