Take a look to OSGi Configuration Admin, you can modify component properties in execution time (that is, you can modify the properties of the services present in the DS.xml for example):
Configuration conf = configAdmin.getConfiguration("YourComponentName");
Dictionary dict = conf.getProperties();
//check things or whatever
dict = new Hashtable();
dict.put("service.exported.interfaces", "*");
dict.put("service.exported.configs", "ecf.generic.server");
dict.put("ecf.exported.containerfactoryargs", "ecftcp://localhost:3789/server");
conf.update(dict);
After that, I have to restart the component from the command line to let ECF the creation of the container:
disable yourComponentID
enable yourComponentID
I still don't know how to do this part automatically. I am still investigating in Configuration Admin and Remote Services Admin. If you, or other, can help, it would be nice ;)
I am also interested in your question. I think there are no much docummentation about distributed services in WANs.