use of org.osgi.service.cdi.annotations.Configuration in project aries by apache.
the class ConfigurationExtension method processInjectionTarget.
void processInjectionTarget(@Observes @SuppressWarnings("rawtypes") ProcessInjectionPoint pip) {
InjectionPoint injectionPoint = pip.getInjectionPoint();
Annotated annotated = injectionPoint.getAnnotated();
Configuration configuration = annotated.getAnnotation(Configuration.class);
if (configuration == null) {
return;
}
Class<?> beanClass = injectionPoint.getBean().getBeanClass();
String name = beanClass.getName();
Named named = annotated.getAnnotation(Named.class);
if (named != null) {
name = named.value();
}
ConfigurationDependency configurationDependency = new ConfigurationDependency(_bundleContext, configuration.value(), configuration.required(), name, injectionPoint);
_configurations.add(configurationDependency);
if (_log.isDebugEnabled()) {
_log.debug("CDIe - Found OSGi configuration dependency {}", configurationDependency);
}
}
Aggregations