- Class<?> requiredInterface = entry.getKey().osgiRegistrationType();
- checkState(requiredInterface.isInstance(instance), instance.getClass().getName() +
+ ServiceInterfaceAnnotation annotation = entry.getKey();
+ Class<?> requiredInterface = annotation.osgiRegistrationType();
+
+ if(!annotation.registerToOsgi()) {
+ LOG.debug("registerToOsgi for service interface {} is false - not registering", requiredInterface);
+ continue;
+ }
+
+ Preconditions.checkState(requiredInterface.isInstance(instance), instance.getClass().getName() +