if (!eat.isAbstract() || !eat.getJavaClass().isInterface()) { // injectionTargetCannotBeCreatedForInterface ((AbstractClassBean)bean).setProducer(beanManager.getLocalInjectionTargetFactory(eat).createInjectionTarget(eat, bean, false)); if (isReinjectingContext(bean)) {
public boolean isAbstract() { return delegate().isAbstract(); }
public boolean isAbstract() { return delegate().isAbstract(); }
@SuppressWarnings("unchecked") private void checkAbstractMethods(EnhancedAnnotatedType<T> type) { if(!type.isAbstract()) { return; } Set<Type> decoratedTypes = null; Bean<?> bean = getBean(); if(bean != null && (bean instanceof DecoratorImpl)) { decoratedTypes = ((DecoratorImpl<T>)bean).getDecoratedTypes(); } Decorators.checkAbstractMethods(decoratedTypes, type, beanManager); } }
@SuppressWarnings("unchecked") private void checkAbstractMethods(EnhancedAnnotatedType<T> type) { if(!type.isAbstract()) { return; } Set<Type> decoratedTypes = null; Bean<?> bean = getBean(); if(bean != null && (bean instanceof DecoratorImpl)) { decoratedTypes = ((DecoratorImpl<T>)bean).getDecoratedTypes(); } Decorators.checkAbstractMethods(decoratedTypes, type, beanManager); } }
@SuppressWarnings("unchecked") private void checkAbstractMethods(EnhancedAnnotatedType<T> type) { if(!type.isAbstract()) { return; } Set<Type> decoratedTypes = null; Bean<?> bean = getBean(); if(bean != null && (bean instanceof DecoratorImpl)) { decoratedTypes = ((DecoratorImpl<T>)bean).getDecoratedTypes(); } Decorators.checkAbstractMethods(decoratedTypes, type, beanManager); } }
@SuppressWarnings("unchecked") private void checkAbstractMethods(EnhancedAnnotatedType<T> type) { if(!type.isAbstract()) { return; } Set<Type> decoratedTypes = null; Bean<?> bean = getBean(); if(bean != null && (bean instanceof DecoratorImpl)) { decoratedTypes = ((DecoratorImpl<T>)bean).getDecoratedTypes(); } Decorators.checkAbstractMethods(decoratedTypes, type, beanManager); } }
@SuppressWarnings("unchecked") private void checkAbstractMethods(EnhancedAnnotatedType<T> type) { if(!type.isAbstract()) { return; } Set<Type> decoratedTypes = null; Bean<?> bean = getBean(); if(bean != null && (bean instanceof DecoratorImpl)) { decoratedTypes = ((DecoratorImpl<T>)bean).getDecoratedTypes(); } Decorators.checkAbstractMethods(decoratedTypes, type, beanManager); } }
@SuppressWarnings("unchecked") private void checkAbstractMethods(EnhancedAnnotatedType<T> type) { if(!type.isAbstract()) { return; } Set<Type> decoratedTypes = null; Bean<?> bean = getBean(); if(bean != null && (bean instanceof DecoratorImpl)) { decoratedTypes = ((DecoratorImpl<T>)bean).getDecoratedTypes(); } Decorators.checkAbstractMethods(decoratedTypes, type, beanManager); } }
@Override protected Instantiator<T> initInstantiator(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager, Set<InjectionPoint> injectionPoints) { if (type.isAbstract()) { ConstructorInjectionPoint<T> originalConstructor = InjectionPointFactory.instance().createConstructorInjectionPoint(bean, type, beanManager); injectionPoints.addAll(originalConstructor.getParameterInjectionPoints()); final WeldInjectionPointAttributes<?, ?> delegateInjectionPoint = Decorators.findDelegateInjectionPoint(type, injectionPoints); return new SubclassedComponentInstantiator<T>(type, bean, originalConstructor, beanManager) { @Override protected Class<T> createEnhancedSubclass(EnhancedAnnotatedType<T> type, Bean<?> bean, BeanManagerImpl manager) { return new DecoratorProxyFactory<T>(manager.getContextId(), type.getJavaClass(), delegateInjectionPoint, bean).getProxyClass(); } }; } else { DefaultInstantiator<T> instantiator = new DefaultInstantiator<T>(type, bean, beanManager); injectionPoints.addAll(instantiator.getConstructorInjectionPoint().getParameterInjectionPoints()); return instantiator; } }
@Override protected Instantiator<T> initInstantiator(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager, Set<InjectionPoint> injectionPoints) { if (type.isAbstract()) { ConstructorInjectionPoint<T> originalConstructor = InjectionPointFactory.instance().createConstructorInjectionPoint(bean, type, beanManager); injectionPoints.addAll(originalConstructor.getParameterInjectionPoints()); final WeldInjectionPointAttributes<?, ?> delegateInjectionPoint = Decorators.findDelegateInjectionPoint(type, injectionPoints); return new SubclassedComponentInstantiator<T>(type, bean, originalConstructor, beanManager) { @Override protected Class<T> createEnhancedSubclass(EnhancedAnnotatedType<T> type, Bean<?> bean, BeanManagerImpl manager) { return new DecoratorProxyFactory<T>(manager.getContextId(), type.getJavaClass(), delegateInjectionPoint, bean).getProxyClass(); } }; } else { DefaultInstantiator<T> instantiator = new DefaultInstantiator<T>(type, bean, beanManager); injectionPoints.addAll(instantiator.getConstructorInjectionPoint().getParameterInjectionPoints()); return instantiator; } }
@Override protected Instantiator<T> initInstantiator(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager, Set<InjectionPoint> injectionPoints) { if (type.isAbstract()) { ConstructorInjectionPoint<T> originalConstructor = InjectionPointFactory.instance().createConstructorInjectionPoint(bean, type, beanManager); injectionPoints.addAll(originalConstructor.getParameterInjectionPoints()); final WeldInjectionPointAttributes<?, ?> delegateInjectionPoint = Decorators.findDelegateInjectionPoint(type, injectionPoints); return new SubclassedComponentInstantiator<T>(type, bean, originalConstructor, beanManager) { @Override protected Class<T> createEnhancedSubclass(EnhancedAnnotatedType<T> type, Bean<?> bean, BeanManagerImpl manager) { return new DecoratorProxyFactory<T>(manager.getContextId(), type.getJavaClass(), delegateInjectionPoint, bean).getProxyClass(); } }; } else { DefaultInstantiator<T> instantiator = new DefaultInstantiator<T>(type, bean, beanManager); injectionPoints.addAll(instantiator.getConstructorInjectionPoint().getParameterInjectionPoints()); return instantiator; } }
@Override protected Instantiator<T> initInstantiator(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager, Set<InjectionPoint> injectionPoints) { if (type.isAbstract()) { ConstructorInjectionPoint<T> originalConstructor = InjectionPointFactory.instance().createConstructorInjectionPoint(bean, type, beanManager); injectionPoints.addAll(originalConstructor.getParameterInjectionPoints()); final WeldInjectionPointAttributes<?, ?> delegateInjectionPoint = Decorators.findDelegateInjectionPoint(type, injectionPoints); return new SubclassedComponentInstantiator<T>(type, bean, originalConstructor, beanManager) { @Override protected Class<T> createEnhancedSubclass(EnhancedAnnotatedType<T> type, Bean<?> bean, BeanManagerImpl manager) { return new DecoratorProxyFactory<T>(manager.getContextId(), type.getJavaClass(), delegateInjectionPoint, bean).getProxyClass(); } }; } else { DefaultInstantiator<T> instantiator = new DefaultInstantiator<T>(type, bean, beanManager); injectionPoints.addAll(instantiator.getConstructorInjectionPoint().getParameterInjectionPoints()); return instantiator; } }
@Override protected Instantiator<T> initInstantiator(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager, Set<InjectionPoint> injectionPoints) { if (type.isAbstract()) { ConstructorInjectionPoint<T> originalConstructor = InjectionPointFactory.instance().createConstructorInjectionPoint(bean, type, beanManager); injectionPoints.addAll(originalConstructor.getParameterInjectionPoints()); final WeldInjectionPointAttributes<?, ?> delegateInjectionPoint = Decorators.findDelegateInjectionPoint(type, injectionPoints); return new SubclassedComponentInstantiator<T>(type, bean, originalConstructor, beanManager) { @Override protected Class<T> createEnhancedSubclass(EnhancedAnnotatedType<T> type, Bean<?> bean, BeanManagerImpl manager) { return new DecoratorProxyFactory<T>(manager.getContextId(), type.getJavaClass(), delegateInjectionPoint, bean).getProxyClass(); } }; } else { DefaultInstantiator<T> instantiator = new DefaultInstantiator<T>(type, bean, beanManager); injectionPoints.addAll(instantiator.getConstructorInjectionPoint().getParameterInjectionPoints()); return instantiator; } }
@Override protected Instantiator<T> initInstantiator(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager, Set<InjectionPoint> injectionPoints) { if (type.isAbstract()) { ConstructorInjectionPoint<T> originalConstructor = InjectionPointFactory.instance().createConstructorInjectionPoint(bean, type, beanManager); injectionPoints.addAll(originalConstructor.getParameterInjectionPoints()); final WeldInjectionPointAttributes<?, ?> delegateInjectionPoint = Decorators.findDelegateInjectionPoint(type, injectionPoints); return new SubclassedComponentInstantiator<T>(type, bean, originalConstructor, beanManager) { @Override protected Class<T> createEnhancedSubclass(EnhancedAnnotatedType<T> type, Bean<?> bean, BeanManagerImpl manager) { return new DecoratorProxyFactory<T>(manager.getContextId(), type.getJavaClass(), delegateInjectionPoint, bean).getProxyClass(); } }; } else { DefaultInstantiator<T> instantiator = new DefaultInstantiator<T>(type, bean, beanManager); injectionPoints.addAll(instantiator.getConstructorInjectionPoint().getParameterInjectionPoints()); return instantiator; } }
LifecycleCallbackInvoker<T> invoker, BeanManagerImpl beanManager) { try { if (type.isAbstract()) { if (type.getJavaClass().isInterface()) { throw BeanLogger.LOG.injectionTargetCannotBeCreatedForInterface(type);
protected void createClassBean(SlimAnnotatedType<?> annotatedType, SetMultimap<Class<?>, SlimAnnotatedType<?>> otherWeldClasses) { boolean managedBeanOrDecorator = !ejbSupport.isEjb(annotatedType.getJavaClass()) && Beans.isTypeManagedBeanOrDecoratorOrInterceptor(annotatedType); if (managedBeanOrDecorator) { containerLifecycleEvents.preloadProcessInjectionTarget(annotatedType.getJavaClass()); containerLifecycleEvents.preloadProcessBeanAttributes(annotatedType.getJavaClass()); EnhancedAnnotatedType<?> weldClass = classTransformer.getEnhancedAnnotatedType(annotatedType); if (weldClass.isAnnotationPresent(Decorator.class)) { containerLifecycleEvents.preloadProcessBean(ProcessBean.class, annotatedType.getJavaClass()); validateDecorator(weldClass); createDecorator(weldClass); } else if (weldClass.isAnnotationPresent(Interceptor.class)) { containerLifecycleEvents.preloadProcessBean(ProcessBean.class, annotatedType.getJavaClass()); validateInterceptor(weldClass); createInterceptor(weldClass); } else if (!weldClass.isAbstract()) { containerLifecycleEvents.preloadProcessBean(ProcessManagedBean.class, annotatedType.getJavaClass()); createManagedBean(weldClass); } } else { if (Beans.isDecoratorDeclaringInAppropriateConstructor(annotatedType)) { BootstrapLogger.LOG.decoratorWithNonCdiConstructor(annotatedType.getJavaClass().getName()); } Class<? extends Annotation> scopeClass = Beans.getBeanDefiningAnnotationScope(annotatedType); if (scopeClass != null && !Beans.hasSimpleCdiConstructor(annotatedType)) { BootstrapLogger.LOG.annotatedTypeNotRegisteredAsBeanDueToMissingAppropriateConstructor(annotatedType.getJavaClass().getName(), scopeClass.getSimpleName()); } otherWeldClasses.put(annotatedType.getJavaClass(), annotatedType); } }
protected void createClassBean(SlimAnnotatedType<?> annotatedType, SetMultimap<Class<?>, SlimAnnotatedType<?>> otherWeldClasses) { boolean managedBeanOrDecorator = !ejbSupport.isEjb(annotatedType.getJavaClass()) && Beans.isTypeManagedBeanOrDecoratorOrInterceptor(annotatedType); if (managedBeanOrDecorator) { containerLifecycleEvents.preloadProcessInjectionTarget(annotatedType.getJavaClass()); containerLifecycleEvents.preloadProcessBeanAttributes(annotatedType.getJavaClass()); EnhancedAnnotatedType<?> weldClass = classTransformer.getEnhancedAnnotatedType(annotatedType); if (weldClass.isAnnotationPresent(Decorator.class)) { containerLifecycleEvents.preloadProcessBean(ProcessBean.class, annotatedType.getJavaClass()); validateDecorator(weldClass); createDecorator(weldClass); } else if (weldClass.isAnnotationPresent(Interceptor.class)) { containerLifecycleEvents.preloadProcessBean(ProcessBean.class, annotatedType.getJavaClass()); validateInterceptor(weldClass); createInterceptor(weldClass); } else if (!weldClass.isAbstract()) { containerLifecycleEvents.preloadProcessBean(ProcessManagedBean.class, annotatedType.getJavaClass()); createManagedBean(weldClass); } } else { if (Beans.isDecoratorDeclaringInAppropriateConstructor(annotatedType)) { BootstrapLogger.LOG.decoratorWithNonCdiConstructor(annotatedType.getJavaClass().getName()); } Class<? extends Annotation> scopeClass = Beans.getBeanDefiningAnnotationScope(annotatedType); if (scopeClass != null && !Beans.hasSimpleCdiConstructor(annotatedType)) { BootstrapLogger.LOG.annotatedTypeNotRegisteredAsBeanDueToMissingAppropriateConstructor(annotatedType.getJavaClass().getName(), scopeClass.getSimpleName()); } otherWeldClasses.put(annotatedType.getJavaClass(), annotatedType); } }
protected void createClassBean(SlimAnnotatedType<?> annotatedType, SetMultimap<Class<?>, SlimAnnotatedType<?>> otherWeldClasses) { boolean managedBeanOrDecorator = !ejbSupport.isEjb(annotatedType.getJavaClass()) && Beans.isTypeManagedBeanOrDecoratorOrInterceptor(annotatedType); if (managedBeanOrDecorator) { containerLifecycleEvents.preloadProcessInjectionTarget(annotatedType.getJavaClass()); containerLifecycleEvents.preloadProcessBeanAttributes(annotatedType.getJavaClass()); EnhancedAnnotatedType<?> weldClass = classTransformer.getEnhancedAnnotatedType(annotatedType); if (weldClass.isAnnotationPresent(Decorator.class)) { containerLifecycleEvents.preloadProcessBean(ProcessBean.class, annotatedType.getJavaClass()); validateDecorator(weldClass); createDecorator(weldClass); } else if (weldClass.isAnnotationPresent(Interceptor.class)) { containerLifecycleEvents.preloadProcessBean(ProcessBean.class, annotatedType.getJavaClass()); validateInterceptor(weldClass); createInterceptor(weldClass); } else if (!weldClass.isAbstract()) { containerLifecycleEvents.preloadProcessBean(ProcessManagedBean.class, annotatedType.getJavaClass()); createManagedBean(weldClass); } } else { if (Beans.isDecoratorDeclaringInAppropriateConstructor(annotatedType)) { BootstrapLogger.LOG.decoratorWithNonCdiConstructor(annotatedType.getJavaClass().getName()); } Class<? extends Annotation> scopeClass = Beans.getBeanDefiningAnnotationScope(annotatedType); if (scopeClass != null && !Beans.hasSimpleCdiConstructor(annotatedType)) { BootstrapLogger.LOG.annotatedTypeNotRegisteredAsBeanDueToMissingAppropriateConstructor(annotatedType.getJavaClass().getName(), scopeClass.getSimpleName()); } otherWeldClasses.put(annotatedType.getJavaClass(), annotatedType); } }
protected void createClassBean(SlimAnnotatedType<?> annotatedType, SetMultimap<Class<?>, SlimAnnotatedType<?>> otherWeldClasses) { boolean managedBeanOrDecorator = !ejbSupport.isEjb(annotatedType.getJavaClass()) && Beans.isTypeManagedBeanOrDecoratorOrInterceptor(annotatedType); if (managedBeanOrDecorator) { containerLifecycleEvents.preloadProcessInjectionTarget(annotatedType.getJavaClass()); containerLifecycleEvents.preloadProcessBeanAttributes(annotatedType.getJavaClass()); EnhancedAnnotatedType<?> weldClass = classTransformer.getEnhancedAnnotatedType(annotatedType); if (weldClass.isAnnotationPresent(Decorator.class)) { containerLifecycleEvents.preloadProcessBean(ProcessBean.class, annotatedType.getJavaClass()); validateDecorator(weldClass); createDecorator(weldClass); } else if (weldClass.isAnnotationPresent(Interceptor.class)) { containerLifecycleEvents.preloadProcessBean(ProcessBean.class, annotatedType.getJavaClass()); validateInterceptor(weldClass); createInterceptor(weldClass); } else if (!weldClass.isAbstract()) { containerLifecycleEvents.preloadProcessBean(ProcessManagedBean.class, annotatedType.getJavaClass()); createManagedBean(weldClass); } } else { if (Beans.isDecoratorDeclaringInAppropriateConstructor(annotatedType)) { BootstrapLogger.LOG.decoratorWithNonCdiConstructor(annotatedType.getJavaClass().getName()); } Class<? extends Annotation> scopeClass = Beans.getBeanDefiningAnnotationScope(annotatedType); if (scopeClass != null && !Beans.hasSimpleCdiConstructor(annotatedType)) { BootstrapLogger.LOG.annotatedTypeNotRegisteredAsBeanDueToMissingAppropriateConstructor(annotatedType.getJavaClass().getName(), scopeClass.getSimpleName()); } otherWeldClasses.put(annotatedType.getJavaClass(), annotatedType); } }