/**
  * Register a new OSGi service.
  *
  * @param tracked the RegisteredService instance
  * @param service the service to register with OSGi
  * @param serviceInterfaces the interfaces to publish the OSGi service as
  * @param serviceProps properties for the OSGi service
  */
 protected void addRegisteredService(
     R tracked, Object service, String[] serviceInterfaces, Dictionary<String, ?> serviceProps) {
   log.debug("Registering service [{}] with props {}", service, serviceProps);
   synchronized (registeredServices) {
     ServiceRegistration<?> reg =
         bundleContext.registerService(serviceInterfaces, service, serviceProps);
     tracked.setReg(reg);
     registeredServices.add(tracked);
   }
 }