Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] what's the best way to export multiple services via DS

Hi Peter,

On 4/24/2014 5:55 AM, Peter Hermsdorf wrote:
Hi,

what's the best option to export multiple services from one host using DS for service description?

The ECF examples us an DS xml like this:

<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"; enabled="true" immediate="true" name="com.mycorp.examples.timeservice.host.ds">
   <property name="service.exported.interfaces" type="String" value="*"/>
<property name="service.exported.configs" type="String" value="ecf.generic.server"/> <property name="ecf.generic.server.id" type="String" value="ecftcp://localhost:8889/server"/> <implementation class="com.mycorp.examples.timeservice.host.TimeServiceImpl"/>
   <service>
      <provide interface="com.mycorp.examples.timeservice.ITimeService"/>
   </service>
</scr:component>

When exporting another service the lines

   <property name="service.exported.interfaces" type="String" value="*"/>
<property name="service.exported.configs" type="String" value="ecf.generic.server"/> <property name="ecf.generic.server.id" type="String" value="ecftcp://localhost:8889/server"/>

need to be duplicated.
The same problem comes up when configuration is changing, eg. the port.

I tried passing some vm arguments but that wasn't successful...

Right. I think the proper OSGi response to this is probably to use Configuration Admin. Configuration Admin is another part of the OSGi specification that allows one to configure/reconfigure things...including DS components.

Here's [1] an OSGi page describing CA...and if you Google 'osgi configuration admin' you will find lots of other materials about it.

With the ECF generic provider, there are some properties that can be directly manipulated upon container construction...see [2].

Thanks,

Scott

[1] http://wiki.osgi.org/wiki/Configuration_Admin
[2] https://wiki.eclipse.org/EIG:Configuration_Properties


Thanks,
Peter
_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev



Back to the top