use of javax.enterprise.inject.spi.ProcessInjectionPoint 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);
}
}
}
use of javax.enterprise.inject.spi.ProcessInjectionPoint 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