I use OSGi services via manually component definition. Service components consist of an XML description and an object. My project was working just fine until I try to instantiate another service in the same plugin. Now it seems to me, as if I'm not supposed to declare two component.xml file in the same plugin.
component.xml
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="ICustomerOSGiService">
<implementation class="de.checkpoint.rinteln.service.customer.service.CustomerOSGiService"/>
<service>
<provide interface="de.checkpoint.rinteln.carlofon.common.service.ICustomerOSGiService"/>
</service>
</scr:component>
By injecting the interface I can access to the implementation.
Now I want a second component.xml with a different implementation so I can call just like the first. But Eclipse wouldn't let me to it. So I figured, my be i need to separate them. I mean in 2 differents plugins, which has been working fine so far. Still, my plugins look pretty empty now. So I want to combine all the services in the same plugin. Is there any way to concentrate the components as XML? Something like the code below (which I already tried by the way but unfortunately, doesn't work)
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="IOSGiService">
<implementation class="de.checkpoint.rinteln.service.customer.service.CustomerOSGiService"/>
<service>
<provide interface="de.checkpoint.rinteln.carlofon.common.service.ICustomerOSGiService"/>
</service>
<implementation class="de.checkpoint.rinteln.service.customer.service.ReminderOSGiService"/>
<service>
<provide interface="de.checkpoint.rinteln.carlofon.common.service.IReminderOSGiService"/>
</service>
</scr:component>