use of org.opendaylight.controller.config.api.annotations.ServiceInterfaceAnnotation in project controller by opendaylight.
the class InterfacesHelper method getOsgiRegistrationTypes.
/**
* Get OSGi registration types under which config bean instance should be
* registered. This is specified in
* {@link org.opendaylight.controller.config.api.annotations.ServiceInterfaceAnnotation#osgiRegistrationType()}
*
* @param configBeanClass config bean class
* @return set of classes
*/
public static Set<Class<?>> getOsgiRegistrationTypes(final Class<? extends Module> configBeanClass) {
Set<Class<?>> serviceInterfaces = getServiceInterfaces(configBeanClass);
Set<Class<?>> result = new HashSet<>();
for (Class<?> clazz : serviceInterfaces) {
ServiceInterfaceAnnotation annotation = clazz.getAnnotation(ServiceInterfaceAnnotation.class);
result.add(annotation.osgiRegistrationType());
}
return result;
}
use of org.opendaylight.controller.config.api.annotations.ServiceInterfaceAnnotation in project controller by opendaylight.
the class InterfacesHelper method getServiceInterfaceAnnotations.
private static Set<ServiceInterfaceAnnotation> getServiceInterfaceAnnotations(final Set<Class<? extends AbstractServiceInterface>> implementedServiceIntefaces) {
Set<Class<? extends AbstractServiceInterface>> inspected = getAllAbstractServiceInterfaceClasses(implementedServiceIntefaces);
Set<ServiceInterfaceAnnotation> result = new HashSet<>();
// AbstractSI
for (Class<?> clazz : inspected) {
ServiceInterfaceAnnotation annotation = clazz.getAnnotation(ServiceInterfaceAnnotation.class);
if (annotation != null) {
result.add(annotation);
}
}
return Collections.unmodifiableSet(result);
}
Aggregations