new ServiceTrackerCustomizer() {
public Object addingService(
final ServiceReference reference) {
// register all known services for discovery
final ServiceDiscoveryHandler handler = (ServiceDiscoveryHandler) context
.getService(reference);
final RemoteServiceRegistration[] regs = (RemoteServiceRegistration[]) serviceRegistrations
.values()
.toArray(
new RemoteServiceRegistration[serviceRegistrations
.size()]);
for (int i = 0; i < regs.length; i++) {
handler
.registerService(
regs[i].getReference(),
regs[i].getProperties(),
URI
.create("r-osgi://" //$NON-NLS-1$