/** * Creates a new constructor injection point suitable for Jersey components. * * @param constructor resolved constructor that can be injected using Jersey. * @param bean bean descriptor dedicated to the parent class. * @param manager current bean manager. * @param resolvers all registered resolvers. */ public JerseyConstructorInjectionPoint(EnhancedAnnotatedConstructor<T> constructor, Bean<T> bean, BeanManagerImpl manager, Collection<InjectionResolver> resolvers) { super(constructor, null, constructor.getJavaClass(), InjectionPointFactory.instance(), manager); List<InjecteeToSupplier> valueSuppliers = createValueSuppliers(constructor.getJavaMember(), getParameterInjectionPoints(), resolvers); /* * Caches either created proxies if the component class is not RequestScoped or caches the supplier that just create * values every component creates. */ if (proxyResolver.isPrixiable(bean.getScope())) { this.cachedProxies = generateProxies(valueSuppliers); } else { this.cachedSuppliers = valueSuppliers.stream() .map(is -> is.supplier) .collect(Collectors.toList()); } }
public DefaultInjector(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager) { this.injectableFields = InjectionPointFactory.instance().getFieldInjectionPoints(bean, type, beanManager); this.initializerMethods = BeanMethods.getInitializerMethods(bean, type, beanManager); }
protected MethodInjectionPoint<T, ? super X> initMethodInjectionPoint(EnhancedAnnotatedMethod<T, ? super X> observer, RIBean<X> declaringBean, BeanManagerImpl manager) { return InjectionPointFactory.instance().createMethodInjectionPoint(MethodInjectionPointType.OBSERVER, observer, declaringBean, declaringBean.getBeanClass(), SPECIAL_PARAM_MARKERS, manager); }
protected MethodInjectionPoint<T, ? super X> initMethodInjectionPoint(EnhancedAnnotatedMethod<T, ? super X> observer, RIBean<X> declaringBean, BeanManagerImpl manager) { return InjectionPointFactory.instance().createMethodInjectionPoint(MethodInjectionPointType.OBSERVER, observer, declaringBean, declaringBean.getBeanClass(), SPECIAL_PARAM_MARKERS, manager); }
public ProducerMethodProducer(EnhancedAnnotatedMethod<T, ? super X> enhancedAnnotatedMethod, DisposalMethod<?, ?> disposalMethod) { super(enhancedAnnotatedMethod, disposalMethod); // Note that for producer method injection points the declaring bean is the producer method itself this.method = InjectionPointFactory.instance().createMethodInjectionPoint(MethodInjectionPointType.PRODUCER, enhancedAnnotatedMethod, getBean(), enhancedAnnotatedMethod.getDeclaringType().getJavaClass(), null, getBeanManager()); checkProducerMethod(enhancedAnnotatedMethod); checkDelegateInjectionPoints(); }
protected DisposalMethod(BeanManagerImpl beanManager, EnhancedAnnotatedMethod<T, ? super X> enhancedAnnotatedMethod, AbstractClassBean<X> declaringBean) { this.disposalMethodInjectionPoint = InjectionPointFactory.instance().createMethodInjectionPoint(MethodInjectionPointType.DISPOSER, enhancedAnnotatedMethod, declaringBean, declaringBean.getBeanClass(), SPECIAL_PARAM_MARKERS, beanManager); this.beanManager = beanManager; this.declaringBean = declaringBean; EnhancedAnnotatedParameter<?, ? super X> enhancedDisposesParameter = getEnhancedDisposesParameter(enhancedAnnotatedMethod); this.disposesParameter = enhancedDisposesParameter.slim(); this.requiredQualifiers = getRequiredQualifiers(enhancedDisposesParameter); checkDisposalMethod(enhancedAnnotatedMethod, declaringBean); this.invocationStrategy = MethodInvocationStrategy.forDisposer(disposalMethodInjectionPoint, beanManager); }
public static <T> SubclassedComponentInstantiator<T> forSubclassedEjb(EnhancedAnnotatedType<T> componentType, EnhancedAnnotatedType<T> subclass, Bean<T> bean, BeanManagerImpl manager) { final EnhancedAnnotatedConstructor<T> componentConstructor = Beans.getBeanConstructor(componentType); final EnhancedAnnotatedConstructor<T> subclassConstructor = findMatchingConstructor(componentConstructor.getSignature(), subclass); final ConstructorInjectionPoint<T> cip = InjectionPointFactory.instance().createConstructorInjectionPoint(bean, componentType.getJavaClass(), subclassConstructor, manager); return new SubclassedComponentInstantiator<T>(cip, componentConstructor.getJavaMember()); }
protected DisposalMethod(BeanManagerImpl beanManager, EnhancedAnnotatedMethod<T, ? super X> enhancedAnnotatedMethod, AbstractClassBean<X> declaringBean) { this.disposalMethodInjectionPoint = InjectionPointFactory.instance().createMethodInjectionPoint(MethodInjectionPointType.DISPOSER, enhancedAnnotatedMethod, declaringBean, declaringBean.getBeanClass(), SPECIAL_PARAM_MARKERS, beanManager); this.beanManager = beanManager; this.declaringBean = declaringBean; EnhancedAnnotatedParameter<?, ? super X> enhancedDisposesParameter = getEnhancedDisposesParameter(enhancedAnnotatedMethod); this.disposesParameter = enhancedDisposesParameter.slim(); this.requiredQualifiers = getRequiredQualifiers(enhancedDisposesParameter); checkDisposalMethod(enhancedAnnotatedMethod, declaringBean); this.invocationStrategy = MethodInvocationStrategy.forDisposer(disposalMethodInjectionPoint, beanManager); }
public ProducerMethodProducer(EnhancedAnnotatedMethod<T, ? super X> enhancedAnnotatedMethod, DisposalMethod<?, ?> disposalMethod) { super(enhancedAnnotatedMethod, disposalMethod); // Note that for producer method injection points the declaring bean is the producer method itself this.method = InjectionPointFactory.instance().createMethodInjectionPoint(MethodInjectionPointType.PRODUCER, enhancedAnnotatedMethod, getBean(), enhancedAnnotatedMethod.getDeclaringType().getJavaClass(), null, getBeanManager()); checkProducerMethod(enhancedAnnotatedMethod); checkDelegateInjectionPoints(); }
protected DisposalMethod(BeanManagerImpl beanManager, EnhancedAnnotatedMethod<T, ? super X> enhancedAnnotatedMethod, AbstractClassBean<X> declaringBean) { this.disposalMethodInjectionPoint = InjectionPointFactory.instance().createMethodInjectionPoint(MethodInjectionPointType.DISPOSER, enhancedAnnotatedMethod, declaringBean, declaringBean.getBeanClass(), SPECIAL_PARAM_MARKERS, beanManager); this.beanManager = beanManager; this.declaringBean = declaringBean; EnhancedAnnotatedParameter<?, ? super X> enhancedDisposesParameter = getEnhancedDisposesParameter(enhancedAnnotatedMethod); this.disposesParameter = enhancedDisposesParameter.slim(); this.requiredQualifiers = getRequiredQualifiers(enhancedDisposesParameter); checkDisposalMethod(enhancedAnnotatedMethod, declaringBean); this.invocationStrategy = MethodInvocationStrategy.forDisposer(disposalMethodInjectionPoint, beanManager); }
public static <T> SubclassedComponentInstantiator<T> forSubclassedEjb(EnhancedAnnotatedType<T> componentType, EnhancedAnnotatedType<T> subclass, Bean<T> bean, BeanManagerImpl manager) { final EnhancedAnnotatedConstructor<T> componentConstructor = Beans.getBeanConstructor(componentType); final EnhancedAnnotatedConstructor<T> subclassConstructor = findMatchingConstructor(componentConstructor.getSignature(), subclass); final ConstructorInjectionPoint<T> cip = InjectionPointFactory.instance().createConstructorInjectionPoint(bean, componentType.getJavaClass(), subclassConstructor, manager); return new SubclassedComponentInstantiator<T>(cip, componentConstructor.getJavaMember()); }
public ProducerMethodProducer(EnhancedAnnotatedMethod<T, ? super X> enhancedAnnotatedMethod, DisposalMethod<?, ?> disposalMethod) { super(enhancedAnnotatedMethod, disposalMethod); // Note that for producer method injection points the declaring bean is the producer method itself this.method = InjectionPointFactory.instance().createMethodInjectionPoint(MethodInjectionPointType.PRODUCER, enhancedAnnotatedMethod, getBean(), enhancedAnnotatedMethod.getDeclaringType().getJavaClass(), null, getBeanManager()); checkProducerMethod(enhancedAnnotatedMethod); checkDelegateInjectionPoints(); }
public static <T> SubclassedComponentInstantiator<T> forSubclassedEjb(EnhancedAnnotatedType<T> componentType, EnhancedAnnotatedType<T> subclass, Bean<T> bean, BeanManagerImpl manager) { final EnhancedAnnotatedConstructor<T> componentConstructor = Beans.getBeanConstructor(componentType); final EnhancedAnnotatedConstructor<T> subclassConstructor = findMatchingConstructor(componentConstructor.getSignature(), subclass); final ConstructorInjectionPoint<T> cip = InjectionPointFactory.instance().createConstructorInjectionPoint(bean, componentType.getJavaClass(), subclassConstructor, manager); return new SubclassedComponentInstantiator<T>(cip, componentConstructor.getJavaMember()); }
protected DisposalMethod(BeanManagerImpl beanManager, EnhancedAnnotatedMethod<T, ? super X> enhancedAnnotatedMethod, AbstractClassBean<X> declaringBean) { this.disposalMethodInjectionPoint = InjectionPointFactory.instance().createMethodInjectionPoint(MethodInjectionPointType.DISPOSER, enhancedAnnotatedMethod, declaringBean, declaringBean.getBeanClass(), SPECIAL_PARAM_MARKERS, beanManager); this.beanManager = beanManager; this.declaringBean = declaringBean; EnhancedAnnotatedParameter<?, ? super X> enhancedDisposesParameter = getEnhancedDisposesParameter(enhancedAnnotatedMethod); this.disposesParameter = enhancedDisposesParameter.slim(); this.requiredQualifiers = getRequiredQualifiers(enhancedDisposesParameter); checkDisposalMethod(enhancedAnnotatedMethod, declaringBean); this.invocationStrategy = MethodInvocationStrategy.forDisposer(disposalMethodInjectionPoint, beanManager); }
protected DisposalMethod(BeanManagerImpl beanManager, EnhancedAnnotatedMethod<T, ? super X> enhancedAnnotatedMethod, AbstractClassBean<X> declaringBean) { this.disposalMethodInjectionPoint = InjectionPointFactory.instance().createMethodInjectionPoint(MethodInjectionPointType.DISPOSER, enhancedAnnotatedMethod, declaringBean, declaringBean.getBeanClass(), SPECIAL_PARAM_MARKERS, beanManager); this.beanManager = beanManager; this.declaringBean = declaringBean; EnhancedAnnotatedParameter<?, ? super X> enhancedDisposesParameter = getEnhancedDisposesParameter(enhancedAnnotatedMethod); this.disposesParameter = enhancedDisposesParameter.slim(); this.requiredQualifiers = getRequiredQualifiers(enhancedDisposesParameter); checkDisposalMethod(enhancedAnnotatedMethod, declaringBean); this.invocationStrategy = MethodInvocationStrategy.forDisposer(disposalMethodInjectionPoint, beanManager); }
public ProducerMethodProducer(EnhancedAnnotatedMethod<T, ? super X> enhancedAnnotatedMethod, DisposalMethod<?, ?> disposalMethod) { super(enhancedAnnotatedMethod, disposalMethod); // Note that for producer method injection points the declaring bean is the producer method itself this.method = InjectionPointFactory.instance().createMethodInjectionPoint(MethodInjectionPointType.PRODUCER, enhancedAnnotatedMethod, getBean(), enhancedAnnotatedMethod.getDeclaringType().getJavaClass(), null, getBeanManager()); checkProducerMethod(enhancedAnnotatedMethod); checkDelegateInjectionPoints(); }
protected DisposalMethod(BeanManagerImpl beanManager, EnhancedAnnotatedMethod<T, ? super X> enhancedAnnotatedMethod, AbstractClassBean<X> declaringBean) { this.disposalMethodInjectionPoint = InjectionPointFactory.instance().createMethodInjectionPoint(MethodInjectionPointType.DISPOSER, enhancedAnnotatedMethod, declaringBean, declaringBean.getBeanClass(), Disposes.class, beanManager); this.beanManager = beanManager; this.declaringBean = declaringBean; EnhancedAnnotatedParameter<?, ? super X> enhancedDisposesParameter = getEnhancedDisposesParameter(enhancedAnnotatedMethod); this.disposesParameter = enhancedDisposesParameter.slim(); this.requiredQualifiers = getRequiredQualifiers(enhancedDisposesParameter); checkDisposalMethod(enhancedAnnotatedMethod, declaringBean); this.invocationStrategy = MethodInvocationStrategy.forDisposer(disposalMethodInjectionPoint, beanManager); }
public ProducerMethodProducer(EnhancedAnnotatedMethod<T, ? super X> enhancedAnnotatedMethod, DisposalMethod<?, ?> disposalMethod) { super(enhancedAnnotatedMethod, disposalMethod); // Note that for producer method injection points the declaring bean is the producer method itself this.method = InjectionPointFactory.instance().createMethodInjectionPoint(MethodInjectionPointType.PRODUCER, enhancedAnnotatedMethod, getBean(), enhancedAnnotatedMethod.getDeclaringType().getJavaClass(), null, getBeanManager()); checkProducerMethod(enhancedAnnotatedMethod); checkDelegateInjectionPoints(); }
public static <T> SubclassedComponentInstantiator<T> forSubclassedEjb(EnhancedAnnotatedType<T> componentType, EnhancedAnnotatedType<T> subclass, Bean<T> bean, BeanManagerImpl manager) { final EnhancedAnnotatedConstructor<T> componentConstructor = Beans.getBeanConstructor(componentType); final EnhancedAnnotatedConstructor<T> subclassConstructor = findMatchingConstructor(componentConstructor.getSignature(), subclass); final ConstructorInjectionPoint<T> cip = InjectionPointFactory.instance().createConstructorInjectionPoint(bean, componentType.getJavaClass(), subclassConstructor, manager); return new SubclassedComponentInstantiator<T>(cip, componentConstructor.getJavaMember()); }
public static <T> SubclassedComponentInstantiator<T> forSubclassedEjb(EnhancedAnnotatedType<T> componentType, EnhancedAnnotatedType<T> subclass, Bean<T> bean, BeanManagerImpl manager) { final EnhancedAnnotatedConstructor<T> componentConstructor = Beans.getBeanConstructor(componentType); final EnhancedAnnotatedConstructor<T> subclassConstructor = findMatchingConstructor(componentConstructor.getSignature(), subclass); final ConstructorInjectionPoint<T> cip = InjectionPointFactory.instance().createConstructorInjectionPoint(bean, componentType.getJavaClass(), subclassConstructor, manager); return new SubclassedComponentInstantiator<T>(cip, componentConstructor.getJavaMember()); }