code: @SuppressWarnings("rawtypes")
      protected <S> ServiceRegistration registerService(Class<S> clazz, S service,
              Map<String, ?> props) {
          if (service instanceof IBundleAwareService) {
              ((IBundleAwareService) service).setBundle(bundle);
          }
  
          Dictionary<String, Object> _p = new Hashtable<String, Object>();
          if (props != null) {
              for (Entry<String, ?> entry : props.entrySet()) {
                  _p.put(entry.getKey(), entry.getValue());
              }
          }
          ServiceRegistration sr = bundleContext.registerService(clazz, service, _p);
          registeredServices.add(sr);
          return sr;
      }
docs: Registers a service.
  
  @param clazz
  @param service
  @param props
  @return