use of org.osgi.service.cdi.annotations.Reference in project aries by apache.
the class ReferenceExtension method processInjectionTarget.
void processInjectionTarget(@Observes @SuppressWarnings("rawtypes") ProcessInjectionPoint pip, BeanManager manager) {
InjectionPoint injectionPoint = pip.getInjectionPoint();
Annotated annotated = injectionPoint.getAnnotated();
Reference reference = annotated.getAnnotation(Reference.class);
if (reference == null) {
return;
}
try {
BeanManagerImpl beanManagerImpl = ((BeanManagerProxy) manager).delegate();
ReferenceDependency referenceDependency = new ReferenceDependency(beanManagerImpl, reference, injectionPoint);
_referenceDependencies.add(referenceDependency);
if (_log.isDebugEnabled()) {
_log.debug("CDIe - Found OSGi service reference {}", referenceDependency);
}
} catch (Exception e) {
if (_log.isErrorEnabled()) {
_log.error("CDIe - Error on reference {}", reference, e);
}
}
}
Aggregations