/** * * @param injectionTarget * @param componentDescription * @param beanManager * @return the processed injection target * @see #isProcessing(ComponentDescription) */ default <T> InjectionTarget<T> processInjectionTarget(WeldInjectionTarget<T> injectionTarget, ComponentDescription componentDescription, WeldManager beanManager) { return beanManager.fireProcessInjectionTarget(injectionTarget.getAnnotatedType(), injectionTarget); }
return beanManager.getInjectionTargetFactory(type).createNonProducibleInjectionTarget(); builder.setBean(bean); builder.setResourceInjectionEnabled(false); // because these are all EE components where resource injection is not handled by Weld if (interceptionSupport) { return builder.build(); } else { return builder.setInterceptionEnabled(false).setTargetClassLifecycleCallbacksEnabled(false).setDecorationEnabled(false).build();
bm = ((WeldManager) bm).unwrap();
@Override protected void validateObserverMethods(Iterable<ObserverInitializationContext<?, ?>> observers, final BeanManagerImpl beanManager) { executor.invokeAllAndCheckForExceptions(new IterativeWorkerTaskFactory<ObserverInitializationContext<?, ?>>(observers) { protected void doWork(ObserverInitializationContext<?, ?> observerMethod) { for (InjectionPoint ip : observerMethod.getObserver().getInjectionPoints()) { validateInjectionPointForDefinitionErrors(ip, ip.getBean(), beanManager); validateMetadataInjectionPoint(ip, null, ValidatorLogger.INJECTION_INTO_NON_BEAN); validateInjectionPointForDeploymentProblems(ip, ip.getBean(), beanManager); } } }); }
AnnotatedType<?> type = beanManager.createAnnotatedType(interceptor); @SuppressWarnings("rawtypes") InjectionTarget injectionTarget = beanManager.getInjectionTargetFactory(type).createInterceptorInjectionTarget(); interceptorInjections.put(interceptor, beanManager.fireProcessInjectionTarget(type, injectionTarget));
@Override public void validateProducers(Collection<Producer<?>> producers, final BeanManagerImpl beanManager) { executor.invokeAllAndCheckForExceptions(new IterativeWorkerTaskFactory<Producer<?>>(producers) { protected void doWork(Producer<?> producer) { validateProducer(producer, beanManager); } }); } }
/** * * @param injectionTarget * @param componentDescription * @param beanManager * @return the processed injection target * @see #isProcessing(ComponentDescription) */ default <T> InjectionTarget<T> processInjectionTarget(WeldInjectionTarget<T> injectionTarget, ComponentDescription componentDescription, WeldManager beanManager) { return beanManager.fireProcessInjectionTarget(injectionTarget.getAnnotatedType(), injectionTarget); }
@Override public void validateProducers(Collection<Producer<?>> producers, final BeanManagerImpl beanManager) { executor.invokeAllAndCheckForExceptions(new IterativeWorkerTaskFactory<Producer<?>>(producers) { protected void doWork(Producer<?> producer) { validateProducer(producer, beanManager); } }); } }
@Override public void validateInterceptors(Collection<? extends Interceptor<?>> interceptors, final BeanManagerImpl manager) { executor.invokeAllAndCheckForExceptions(new IterativeWorkerTaskFactory<Interceptor<?>>(interceptors) { protected void doWork(Interceptor<?> interceptor) { validateInterceptor(interceptor, manager); } }); }
@Override public void validateInterceptors(Collection<? extends Interceptor<?>> interceptors, final BeanManagerImpl manager) { executor.invokeAllAndCheckForExceptions(new IterativeWorkerTaskFactory<Interceptor<?>>(interceptors) { protected void doWork(Interceptor<?> interceptor) { validateInterceptor(interceptor, manager); } }); }
@Override public void validateProducers(Collection<Producer<?>> producers, final BeanManagerImpl beanManager) { executor.invokeAllAndCheckForExceptions(new IterativeWorkerTaskFactory<Producer<?>>(producers) { protected void doWork(Producer<?> producer) { validateProducer(producer, beanManager); } }); } }
@Override public void validateInterceptors(Collection<? extends Interceptor<?>> interceptors, final BeanManagerImpl manager) { executor.invokeAllAndCheckForExceptions(new IterativeWorkerTaskFactory<Interceptor<?>>(interceptors) { protected void doWork(Interceptor<?> interceptor) { validateInterceptor(interceptor, manager); } }); }
@Override protected void validateObserverMethods(Iterable<ObserverInitializationContext<?, ?>> observers, final BeanManagerImpl beanManager) { executor.invokeAllAndCheckForExceptions(new IterativeWorkerTaskFactory<ObserverInitializationContext<?, ?>>(observers) { protected void doWork(ObserverInitializationContext<?, ?> observerMethod) { for (InjectionPoint ip : observerMethod.getObserver().getInjectionPoints()) { validateInjectionPointForDefinitionErrors(ip, ip.getBean(), beanManager); validateMetadataInjectionPoint(ip, null, ValidatorLogger.INJECTION_INTO_NON_BEAN); validateInjectionPointForDeploymentProblems(ip, ip.getBean(), beanManager); } } }); }
@Override protected void validateObserverMethods(Iterable<ObserverInitializationContext<?, ?>> observers, final BeanManagerImpl beanManager) { executor.invokeAllAndCheckForExceptions(new IterativeWorkerTaskFactory<ObserverInitializationContext<?, ?>>(observers) { protected void doWork(ObserverInitializationContext<?, ?> observerMethod) { for (InjectionPoint ip : observerMethod.getObserver().getInjectionPoints()) { validateInjectionPointForDefinitionErrors(ip, ip.getBean(), beanManager); validateMetadataInjectionPoint(ip, null, ValidatorLogger.INJECTION_INTO_NON_BEAN); validateInjectionPointForDeploymentProblems(ip, ip.getBean(), beanManager); } } }); }
@Override public void validateProducers(Collection<Producer<?>> producers, final BeanManagerImpl beanManager) { executor.invokeAllAndCheckForExceptions(new IterativeWorkerTaskFactory<Producer<?>>(producers) { protected void doWork(Producer<?> producer) { validateProducer(producer, beanManager); } }); } }
@Override public void validateProducers(Collection<Producer<?>> producers, final BeanManagerImpl beanManager) { executor.invokeAllAndCheckForExceptions(new IterativeWorkerTaskFactory<Producer<?>>(producers) { protected void doWork(Producer<?> producer) { validateProducer(producer, beanManager); } }); } }
@Override public void validateInterceptors(Collection<? extends Interceptor<?>> interceptors, final BeanManagerImpl manager) { executor.invokeAllAndCheckForExceptions(new IterativeWorkerTaskFactory<Interceptor<?>>(interceptors) { protected void doWork(Interceptor<?> interceptor) { validateInterceptor(interceptor, manager); } }); }
@Override protected void validateObserverMethods(Iterable<ObserverInitializationContext<?, ?>> observers, final BeanManagerImpl beanManager) { executor.invokeAllAndCheckForExceptions(new IterativeWorkerTaskFactory<ObserverInitializationContext<?, ?>>(observers) { protected void doWork(ObserverInitializationContext<?, ?> observerMethod) { for (InjectionPoint ip : observerMethod.getObserver().getInjectionPoints()) { validateInjectionPointForDefinitionErrors(ip, ip.getBean(), beanManager); validateMetadataInjectionPoint(ip, null, ValidatorLogger.INJECTION_INTO_NON_BEAN); validateInjectionPointForDeploymentProblems(ip, ip.getBean(), beanManager); } } }); }
@Override public void validateInterceptors(Collection<? extends Interceptor<?>> interceptors, final BeanManagerImpl manager) { executor.invokeAllAndCheckForExceptions(new IterativeWorkerTaskFactory<Interceptor<?>>(interceptors) { protected void doWork(Interceptor<?> interceptor) { validateInterceptor(interceptor, manager); } }); }
@Override protected void validateObserverMethods(Iterable<ObserverInitializationContext<?, ?>> observers, final BeanManagerImpl beanManager) { executor.invokeAllAndCheckForExceptions(new IterativeWorkerTaskFactory<ObserverInitializationContext<?, ?>>(observers) { protected void doWork(ObserverInitializationContext<?, ?> observerMethod) { for (InjectionPoint ip : observerMethod.getObserver().getInjectionPoints()) { validateInjectionPointForDefinitionErrors(ip, ip.getBean(), beanManager); validateMetadataInjectionPoint(ip, null, ValidatorLogger.INJECTION_INTO_NON_BEAN); validateInjectionPointForDeploymentProblems(ip, ip.getBean(), beanManager); } } }); }