Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » SpringDM Managed Service List is not updated with new services
SpringDM Managed Service List is not updated with new services [message #986329] Tue, 20 November 2012 02:37 Go to next message
Eduardo Frazão is currently offline Eduardo FrazãoFriend
Messages: 118
Registered: January 2012
Senior Member
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 13:46 Go to previous message
Eduardo Frazão is currently offline Eduardo FrazãoFriend
Messages: 118
Registered: January 2012
Senior Member
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?
Previous Topic:Servlet Filter cannot be found in classpath other than WEB-INF/...
Next Topic:Virgo Snaps: Templating via Fillter
Goto Forum:
  


Current Time: Mon Dec 22 12:52:39 GMT 2014

Powered by FUDForum. Page generated in 0.01563 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software