Refine search
@Override public void registerInjectionPoints(Set<InjectionPoint> injectionPoints) { injectionPoints.addAll(InjectionPoints.flattenInjectionPoints(this.injectableFields)); injectionPoints.addAll(InjectionPoints.flattenParameterInjectionPoints(this.initializerMethods)); }
private void checkBeanResolved() { if (bean != null) { return; } else if (isUnsatisfied()) { throw BeanManagerLogger.LOG.injectionPointHasUnsatisfiedDependencies(Formats.formatAnnotations(ip.getQualifiers()), Formats.formatInjectionPointType(ip.getType()), InjectionPoints.getUnsatisfiedDependenciesAdditionalInfo(ip, getBeanManager())); } else { throw BeanManagerLogger.LOG.injectionPointHasAmbiguousDependencies(Formats.formatAnnotations(ip.getQualifiers()), Formats.formatInjectionPointType(ip.getType()), WeldCollections.toMultiRowString(allBeans())); } }
public static WeldInjectionPointAttributes<?, ?> findDelegateInjectionPoint(AnnotatedType<?> type, Iterable<InjectionPoint> injectionPoints) { WeldInjectionPointAttributes<?, ?> result = null; for (InjectionPoint injectionPoint : injectionPoints) { if (injectionPoint.isDelegate()) { if (result != null) { throw BeanLogger.LOG.tooManyDelegateInjectionPoints(type); } result = InjectionPoints.getWeldInjectionPoint(injectionPoint); } } if (result == null) { throw BeanLogger.LOG.noDelegateInjectionPoint(type); } return result; }
if (ij.isDelegate()) { return; // do not validate delegate injection points as these are special throw ValidatorLogger.LOG.injectionPointHasUnsatisfiedDependencies( ij, Formats.formatAnnotations(ij.getQualifiers()), Formats.formatInjectionPointType(ij.getType()), Formats.formatAsStackTraceElement(ij), InjectionPoints.getUnsatisfiedDependenciesAdditionalInfo(ij, beanManager)); Formats.formatInjectionPointType(ij.getType()), Formats.formatAsStackTraceElement(ij), WeldCollections.toMultiRowString(resolvedBeans));
boolean delegateInjectionPoint = injectionPoint != null && injectionPoint.isDelegate(); Type requestedType = null; if (injectionPoint != null) { requestedType = injectionPoint.getType(); if (clientProxyOptimization && injectionPoint != null && injectionPoint.getBean() != null) { if (InjectionPoints.isInjectableReferenceLookupOptimizationAllowed(bean, resolvedBean)) { if (weldCreationalContext != null) { final Object incompleteInstance = weldCreationalContext.getIncompleteInstance(resolvedBean); if (context != null) { @SuppressWarnings({ "unchecked", "rawtypes" }) final Object existinInstance = context.get(Reflections.<Contextual> cast(resolvedBean)); if (existinInstance != null) { return existinInstance;
public void addNewBeansFromInjectionPoints(Set<? extends InjectionPoint> injectionPoints) { for (InjectionPoint injectionPoint : injectionPoints) { WeldInjectionPointAttributes<?, ?> weldInjectionPoint = InjectionPoints.getWeldInjectionPoint(injectionPoint); if (weldInjectionPoint.getQualifier(New.class) != null) { Class<?> rawType = Reflections.getRawType(weldInjectionPoint.getType()); if (Event.class.equals(rawType)) { continue; } New _new = weldInjectionPoint.getQualifier(New.class); if (_new.value().equals(New.class)) { if (rawType.equals(Instance.class)) { // e.g. @Inject @New(ChequePaymentProcessor.class) Instance<PaymentProcessor> chequePaymentProcessor; // see WELD-975 Type typeParameter = Reflections.getActualTypeArguments(weldInjectionPoint.getType())[0]; addNewBeanFromInjectionPoint(Reflections.getRawType(typeParameter), typeParameter); } else { addNewBeanFromInjectionPoint(rawType, weldInjectionPoint.getType()); } } else { addNewBeanFromInjectionPoint(_new.value(), _new.value()); } } } }
protected AbstractCallableInjectionPoint(EnhancedAnnotatedCallable<T, X, S> callable, Bean<?> declaringBean, Class<?> declaringComponentClass, boolean observerOrDisposer, InjectionPointFactory factory, BeanManagerImpl manager) { this.declaringBean = declaringBean; this.parameters = factory.getParameterInjectionPoints(callable, declaringBean, declaringComponentClass, manager, observerOrDisposer); if (observerOrDisposer) { this.injectionPoints = cast(InjectionPoints.filterOutSpecialParameterInjectionPoints(parameters)); } else { this.injectionPoints = new ListToSet<InjectionPoint>() { @Override protected List<InjectionPoint> delegate() { return cast(getParameterInjectionPoints()); } }; } this.hasTransientReferenceParameter = initHasTransientReference(callable.getEnhancedParameters()); }
protected AbstractCallableInjectionPoint(EnhancedAnnotatedCallable<T, X, S> callable, Bean<?> declaringBean, Class<?> declaringComponentClass, boolean observerOrDisposer, InjectionPointFactory factory, BeanManagerImpl manager) { this.declaringBean = declaringBean; this.parameters = factory.getParameterInjectionPoints(callable, declaringBean, declaringComponentClass, manager, observerOrDisposer); if (observerOrDisposer) { this.injectionPoints = InjectionPoints.filterOutSpecialParameterInjectionPoints(parameters); } else { this.injectionPoints = new ListToSet<InjectionPoint>() { @Override protected List<InjectionPoint> delegate() { return cast(getParameterInjectionPoints()); } }; } this.hasTransientReferenceParameter = initHasTransientReference(callable.getEnhancedParameters()); }
if (ij.isDelegate()) { return; // do not validate delegate injection points as these are special throw ValidatorLogger.LOG.injectionPointHasUnsatisfiedDependencies( ij, Formats.formatAnnotations(ij.getQualifiers()), Formats.formatInjectionPointType(ij.getType()), Formats.formatAsStackTraceElement(ij), InjectionPoints.getUnsatisfiedDependenciesAdditionalInfo(ij, beanManager)); Formats.formatInjectionPointType(ij.getType()), Formats.formatAsStackTraceElement(ij), WeldCollections.toMultiRowString(resolvedBeans));
boolean delegateInjectionPoint = injectionPoint != null && injectionPoint.isDelegate(); Type requestedType = null; if (injectionPoint != null) { requestedType = injectionPoint.getType(); if (clientProxyOptimization && injectionPoint != null && injectionPoint.getBean() != null) { if (InjectionPoints.isInjectableReferenceLookupOptimizationAllowed(bean, resolvedBean)) { if (weldCreationalContext != null) { final Object incompleteInstance = weldCreationalContext.getIncompleteInstance(resolvedBean); if (context != null) { @SuppressWarnings({ "unchecked", "rawtypes" }) final Object existinInstance = context.get(Reflections.<Contextual> cast(resolvedBean)); if (existinInstance != null) { return existinInstance;
public void addNewBeansFromInjectionPoints(Set<? extends InjectionPoint> injectionPoints) { for (InjectionPoint injectionPoint : injectionPoints) { WeldInjectionPointAttributes<?, ?> weldInjectionPoint = InjectionPoints.getWeldInjectionPoint(injectionPoint); if (weldInjectionPoint.getQualifier(New.class) != null) { Class<?> rawType = Reflections.getRawType(weldInjectionPoint.getType()); if (Event.class.equals(rawType)) { continue; } New _new = weldInjectionPoint.getQualifier(New.class); if (_new.value().equals(New.class)) { if (rawType.equals(Instance.class)) { // e.g. @Inject @New(ChequePaymentProcessor.class) Instance<PaymentProcessor> chequePaymentProcessor; // see WELD-975 Type typeParameter = Reflections.getActualTypeArguments(weldInjectionPoint.getType())[0]; addNewBeanFromInjectionPoint(typeParameter); } else { addNewBeanFromInjectionPoint(weldInjectionPoint.getType()); } } else { addNewBeanFromInjectionPoint(_new.value()); } } } }
protected AbstractCallableInjectionPoint(EnhancedAnnotatedCallable<T, X, S> callable, Bean<?> declaringBean, Class<?> declaringComponentClass, boolean observerOrDisposer, InjectionPointFactory factory, BeanManagerImpl manager) { this.declaringBean = declaringBean; this.parameters = factory.getParameterInjectionPoints(callable, declaringBean, declaringComponentClass, manager, observerOrDisposer); if (observerOrDisposer) { this.injectionPoints = InjectionPoints.filterOutSpecialParameterInjectionPoints(parameters); } else { this.injectionPoints = new ListToSet<InjectionPoint>() { @Override protected List<InjectionPoint> delegate() { return cast(getParameterInjectionPoints()); } }; } this.hasTransientReferenceParameter = initHasTransientReference(callable.getEnhancedParameters()); }
if (ij.isDelegate()) { return; // do not validate delegate injection points as these are special throw ValidatorLogger.LOG.injectionPointHasUnsatisfiedDependencies( ij, Formats.formatAnnotations(ij.getQualifiers()), Formats.formatInjectionPointType(ij.getType()), Formats.formatAsStackTraceElement(ij), InjectionPoints.getUnsatisfiedDependenciesAdditionalInfo(ij, beanManager)); Formats.formatInjectionPointType(ij.getType()), Formats.formatAsStackTraceElement(ij), WeldCollections.toMultiRowString(resolvedBeans));
private void checkBeanResolved() { if (bean != null) { return; } else if (isUnsatisfied()) { throw BeanManagerLogger.LOG.injectionPointHasUnsatisfiedDependencies(Formats.formatAnnotations(ip.getQualifiers()), Formats.formatInjectionPointType(ip.getType()), InjectionPoints.getUnsatisfiedDependenciesAdditionalInfo(ip, getBeanManager())); } else { throw BeanManagerLogger.LOG.injectionPointHasAmbiguousDependencies(Formats.formatAnnotations(ip.getQualifiers()), Formats.formatInjectionPointType(ip.getType()), WeldCollections.toMultiRowString(allBeans())); } }
boolean delegateInjectionPoint = injectionPoint != null && injectionPoint.isDelegate(); Type requestedType = null; if (injectionPoint != null) { requestedType = injectionPoint.getType(); if (clientProxyOptimization && injectionPoint != null && injectionPoint.getBean() != null) { if (InjectionPoints.isInjectableReferenceLookupOptimizationAllowed(bean, resolvedBean)) { if (weldCreationalContext != null) { final Object incompleteInstance = weldCreationalContext.getIncompleteInstance(resolvedBean); if (context != null) { @SuppressWarnings({ "unchecked", "rawtypes" }) final Object existinInstance = context.get(Reflections.<Contextual> cast(resolvedBean)); if (existinInstance != null) { return existinInstance;
public static WeldInjectionPointAttributes<?, ?> findDelegateInjectionPoint(AnnotatedType<?> type, Iterable<InjectionPoint> injectionPoints) { WeldInjectionPointAttributes<?, ?> result = null; for (InjectionPoint injectionPoint : injectionPoints) { if (injectionPoint.isDelegate()) { if (result != null) { throw BeanLogger.LOG.tooManyDelegateInjectionPoints(type); } result = InjectionPoints.getWeldInjectionPoint(injectionPoint); } } if (result == null) { throw BeanLogger.LOG.noDelegateInjectionPoint(type); } return result; }
public void addNewBeansFromInjectionPoints(Set<? extends InjectionPoint> injectionPoints) { for (InjectionPoint injectionPoint : injectionPoints) { WeldInjectionPointAttributes<?, ?> weldInjectionPoint = InjectionPoints.getWeldInjectionPoint(injectionPoint); if (weldInjectionPoint.getQualifier(New.class) != null) { Class<?> rawType = Reflections.getRawType(weldInjectionPoint.getType()); if (Event.class.equals(rawType)) { continue; } New _new = weldInjectionPoint.getQualifier(New.class); if (_new.value().equals(New.class)) { if (rawType.equals(Instance.class)) { // e.g. @Inject @New(ChequePaymentProcessor.class) Instance<PaymentProcessor> chequePaymentProcessor; // see WELD-975 Type typeParameter = Reflections.getActualTypeArguments(weldInjectionPoint.getType())[0]; addNewBeanFromInjectionPoint(typeParameter); } else { addNewBeanFromInjectionPoint(weldInjectionPoint.getType()); } } else { addNewBeanFromInjectionPoint(_new.value()); } } } }
@Override public void registerInjectionPoints(Set<InjectionPoint> injectionPoints) { injectionPoints.addAll(InjectionPoints.flattenInjectionPoints(this.injectableFields)); injectionPoints.addAll(InjectionPoints.flattenParameterInjectionPoints(this.initializerMethods)); }
protected AbstractCallableInjectionPoint(EnhancedAnnotatedCallable<T, X, S> callable, Bean<?> declaringBean, Class<?> declaringComponentClass, boolean observerOrDisposer, InjectionPointFactory factory, BeanManagerImpl manager) { this.declaringBean = declaringBean; this.parameters = factory.getParameterInjectionPoints(callable, declaringBean, declaringComponentClass, manager, observerOrDisposer); if (observerOrDisposer) { this.injectionPoints = InjectionPoints.filterOutSpecialParameterInjectionPoints(parameters); } else { this.injectionPoints = new ListToSet<InjectionPoint>() { @Override protected List<InjectionPoint> delegate() { return cast(getParameterInjectionPoints()); } }; } this.hasTransientReferenceParameter = initHasTransientReference(callable.getEnhancedParameters()); }
if (ij.isDelegate()) { return; // do not validate delegate injection points as these are special throw ValidatorLogger.LOG.injectionPointHasUnsatisfiedDependencies( ij, Formats.formatAnnotations(ij.getQualifiers()), Formats.formatInjectionPointType(ij.getType()), Formats.formatAsStackTraceElement(ij), InjectionPoints.getUnsatisfiedDependenciesAdditionalInfo(ij, beanManager)); Formats.formatInjectionPointType(ij.getType()), Formats.formatAsStackTraceElement(ij), WeldCollections.toMultiRowString(resolvedBeans));