- for (Entry<String, ServiceInterfaceAnnotation> entry : serviceNamesToAnnotations.entrySet()) {
- Class<?> requiredInterface = entry.getValue().osgiRegistrationType();
+ for (Entry<ServiceInterfaceAnnotation, String /* service ref name */> entry : serviceNamesToAnnotations.entrySet()) {
+ ServiceInterfaceAnnotation annotation = entry.getKey();
+ Class<?> requiredInterface = annotation.osgiRegistrationType();
+
+ if(!annotation.registerToOsgi()) {
+ LOG.debug("registerToOsgi for service interface {} is false - not registering", requiredInterface);
+ continue;
+ }
+