/** * Creates a new injection target which is able to delegate an injection to {@code delegate injection target} and inject * the fields that are Jersey-specific. This method accepts custom instantiator, if the instantiator is {@code null} * default one is created. * * @param annotatedType resolved type of the registered bean. * @param delegate CDI specific injection target. * @param bean bean which this injection target belongs to. * @param clazz class that will be scanned and injected. * @param resolvers all resolvers that can provide a valued for Jersey-specific injection. * @param instantiator default instantiator. */ public JerseyInjectionTarget(EnhancedAnnotatedType<T> annotatedType, BasicInjectionTarget<T> delegate, Bean<T> bean, Class<T> clazz, Collection<InjectionResolver> resolvers, Instantiator<T> instantiator) { super(annotatedType, bean, delegate.getBeanManager(), delegate.getInjector(), delegate.getLifecycleCallbackInvoker(), instantiator); this.bean = bean; this.enhancedAnnotatedType = annotatedType; this.clazz = clazz; this.resolvers = resolvers; this.injector = Values.lazy((Value<JerseyInstanceInjector<T>>) () -> new JerseyInstanceInjector<>(bean, this.resolvers)); }
private boolean initHasPostConstructCallback(InjectionTarget<T> producer) { if (producer instanceof BasicInjectionTarget<?>) { BasicInjectionTarget<?> weldProducer = (BasicInjectionTarget<?>) producer; final InterceptionModel interceptors = getInterceptors(); if (interceptors == null || interceptors.getInterceptors(InterceptionType.POST_CONSTRUCT, null).isEmpty()) { if (!weldProducer.getLifecycleCallbackInvoker().hasPostConstructCallback()) { return false; } } } // otherwise we assume there is a post construct callback, just to be safe return true; } }
private boolean initHasPostConstructCallback(InjectionTarget<T> producer) { if (producer instanceof BasicInjectionTarget<?>) { BasicInjectionTarget<?> weldProducer = (BasicInjectionTarget<?>) producer; final InterceptionModel interceptors = getInterceptors(); if (interceptors == null || interceptors.getInterceptors(InterceptionType.POST_CONSTRUCT, null).isEmpty()) { if (!weldProducer.getLifecycleCallbackInvoker().hasPostConstructCallback()) { return false; } } } // otherwise we assume there is a post construct callback, just to be safe return true; } }
private boolean initHasPostConstructCallback(InjectionTarget<T> producer) { if (producer instanceof BasicInjectionTarget<?>) { BasicInjectionTarget<?> weldProducer = (BasicInjectionTarget<?>) producer; final InterceptionModel interceptors = getInterceptors(); if (interceptors == null || interceptors.getInterceptors(InterceptionType.POST_CONSTRUCT, null).isEmpty()) { if (!weldProducer.getLifecycleCallbackInvoker().hasPostConstructCallback()) { return false; } } } // otherwise we assume there is a post construct callback, just to be safe return true; } }
private boolean initHasPostConstructCallback(InjectionTarget<T> producer) { if (producer instanceof BasicInjectionTarget<?>) { BasicInjectionTarget<?> weldProducer = (BasicInjectionTarget<?>) producer; final InterceptionModel interceptors = getInterceptors(); if (interceptors == null || interceptors.getInterceptors(InterceptionType.POST_CONSTRUCT, null).isEmpty()) { if (!weldProducer.getLifecycleCallbackInvoker().hasPostConstructCallback()) { return false; } } } // otherwise we assume there is a post construct callback, just to be safe return true; } }
private boolean initHasPostConstructCallback(InjectionTarget<T> producer) { if (producer instanceof BasicInjectionTarget<?>) { BasicInjectionTarget<?> weldProducer = (BasicInjectionTarget<?>) producer; final InterceptionModel interceptors = getInterceptors(); if (interceptors == null || interceptors.getInterceptors(InterceptionType.POST_CONSTRUCT, null).isEmpty()) { if (!weldProducer.getLifecycleCallbackInvoker().hasPostConstructCallback()) { return false; } } } // otherwise we assume there is a post construct callback, just to be safe return true; } }
private boolean initHasPostConstructCallback(InjectionTarget<T> producer) { if (producer instanceof BasicInjectionTarget<?>) { BasicInjectionTarget<?> weldProducer = (BasicInjectionTarget<?>) producer; final InterceptionModel interceptors = getInterceptors(); if (interceptors == null || interceptors.getInterceptors(InterceptionType.POST_CONSTRUCT, null).isEmpty()) { if (!weldProducer.getLifecycleCallbackInvoker().hasPostConstructCallback()) { return false; } } } // otherwise we assume there is a post construct callback, just to be safe return true; } }
if (managedBean.getProducer() instanceof BasicInjectionTarget<?>) { BasicInjectionTarget<?> injectionTarget = (BasicInjectionTarget<?>) managedBean.getProducer(); if (!injectionTarget.getLifecycleCallbackInvoker().hasPreDestroyMethods() && !injectionTarget.hasInterceptors()) {
if (managedBean.getProducer() instanceof BasicInjectionTarget<?>) { BasicInjectionTarget<?> injectionTarget = (BasicInjectionTarget<?>) managedBean.getProducer(); if (!injectionTarget.getLifecycleCallbackInvoker().hasPreDestroyMethods() && !injectionTarget.hasInterceptors()) {
if (managedBean.getProducer() instanceof BasicInjectionTarget<?>) { BasicInjectionTarget<?> injectionTarget = (BasicInjectionTarget<?>) managedBean.getProducer(); if (!injectionTarget.getLifecycleCallbackInvoker().hasPreDestroyMethods() && !injectionTarget.hasInterceptors()) {
if (managedBean.getProducer() instanceof BasicInjectionTarget<?>) { BasicInjectionTarget<?> injectionTarget = (BasicInjectionTarget<?>) managedBean.getProducer(); if (!injectionTarget.getLifecycleCallbackInvoker().hasPreDestroyMethods() && !injectionTarget.hasInterceptors()) {
if (managedBean.getProducer() instanceof BasicInjectionTarget<?>) { BasicInjectionTarget<?> injectionTarget = (BasicInjectionTarget<?>) managedBean.getProducer(); if (!injectionTarget.getLifecycleCallbackInvoker().hasPreDestroyMethods() && !injectionTarget.hasInterceptors()) {
if (managedBean.getProducer() instanceof BasicInjectionTarget<?>) { BasicInjectionTarget<?> injectionTarget = (BasicInjectionTarget<?>) managedBean.getProducer(); if (!injectionTarget.getLifecycleCallbackInvoker().hasPreDestroyMethods() && !injectionTarget.hasInterceptors()) {