<T> void saveRemoteInjectionPoints(
      @Observes ProcessInjectionTarget<T> event, BeanManager beanManager) {
    final InjectionTarget<T> injectionTarget = event.getInjectionTarget();

    for (InjectionPoint injectionPoint : injectionTarget.getInjectionPoints()) {
      final Annotated annotated = injectionPoint.getAnnotated();
      final Type type = annotated.getBaseType();
      final Class<?> rawType = Reflections.getRawType(annotated.getBaseType());
      final Set<Annotation> qualifiers =
          Reflections.getQualifiers(beanManager, annotated.getAnnotations());

      if (rawType.equals(RemoteCache.class) && qualifiers.isEmpty()) {
        qualifiers.add(new AnnotationLiteral<Default>() {});
        addRemoteCacheInjectionPoint(type, qualifiers);

      } else if (!annotated.isAnnotationPresent(Remote.class)
          && Reflections.getMetaAnnotation(annotated, Remote.class) != null
          && rawType.isAssignableFrom(RemoteCache.class)) {

        addRemoteCacheInjectionPoint(type, qualifiers);
      }
    }
  }
Exemplo n.º 2
0
 private <T extends CamelContextAware> void camelContextAware(
     @Observes ProcessInjectionTarget<T> pit, BeanManager manager) {
   pit.setInjectionTarget(new CamelBeanInjectionTarget<>(pit.getInjectionTarget(), manager));
 }
Exemplo n.º 3
0
 private <T> void camelBeansPostProcessor(
     @Observes ProcessInjectionTarget<T> pit, BeanManager manager) {
   if (camelBeans.contains(pit.getAnnotatedType())) {
     pit.setInjectionTarget(new CamelBeanInjectionTarget<>(pit.getInjectionTarget(), manager));
   }
 }
Exemplo n.º 4
0
 private <T extends CamelContext> void camelContextBeans(
     @Observes ProcessInjectionTarget<T> pit, BeanManager manager) {
   pit.setInjectionTarget(
       environment.camelContextInjectionTarget(
           pit.getInjectionTarget(), pit.getAnnotatedType(), manager, this));
 }
Exemplo n.º 5
0
 <X> void registerGenericBeanInjectionTarget(@Observes ProcessInjectionTarget<X> event) {
   AnnotatedType<X> type = event.getAnnotatedType();
   if (type.isAnnotationPresent(GenericConfiguration.class)) {
     genericInjectionTargets.put(type, event.getInjectionTarget());
   }
 }
Exemplo n.º 6
0
 void observeSimpleBeanInjectionTarget(@Observes ProcessInjectionTarget<SimpleBean> event) {
   this.simpleBeanInjectionTarget = event.getInjectionTarget();
   this.simpleBeanType3 = event.getAnnotatedType();
 }