/** * Constructor * * @param type The type of the bean * @param beanManager The Bean manager */ protected ManagedBean(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, BeanIdentifier identifier, BeanManagerImpl beanManager) { super(attributes, type, identifier, beanManager); this.proxiable = Proxies.isTypesProxyable(getTypes(), beanManager.getServices()); setProducer(beanManager.getLocalInjectionTargetFactory(getEnhancedAnnotated()).createInjectionTarget(getEnhancedAnnotated(), this, false)); }
/** * Constructor * * @param type The type of the bean * @param beanManager The Bean manager */ protected ManagedBean(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, BeanIdentifier identifier, BeanManagerImpl beanManager) { super(attributes, type, identifier, beanManager); this.proxiable = Proxies.isTypesProxyable(getTypes(), beanManager.getServices()); setProducer(beanManager.getLocalInjectionTargetFactory(getEnhancedAnnotated()).createInjectionTarget(getEnhancedAnnotated(), this, false)); }
private void initPassivationCapable() { this.passivationCapableBean = getEnhancedAnnotated().isSerializable(); this.passivationCapableDependency = isNormalScoped() || (isDependent() && passivationCapableBean); }
/** * Constructor * * @param type The type of the bean * @param beanManager The Bean manager */ protected ManagedBean(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, BeanIdentifier identifier, BeanManagerImpl beanManager) { super(attributes, type, identifier, beanManager); this.proxiable = Proxies.isTypesProxyable(getTypes(), beanManager.getServices()); setProducer(beanManager.getLocalInjectionTargetFactory(getEnhancedAnnotated()).createInjectionTarget(getEnhancedAnnotated(), this, false)); }
private void initPassivationCapable() { this.passivationCapableBean = getEnhancedAnnotated().isSerializable(); this.passivationCapableDependency = isNormalScoped() || (isDependent() && passivationCapableBean); }
/** * Constructor * * @param type The type of the bean * @param beanManager The Bean manager */ protected ManagedBean(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, BeanIdentifier identifier, BeanManagerImpl beanManager) { super(attributes, type, identifier, beanManager); this.proxiable = Proxies.isTypesProxyable(getTypes(), beanManager.getServices()); setProducer(beanManager.getLocalInjectionTargetFactory(getEnhancedAnnotated()).createInjectionTarget(getEnhancedAnnotated(), this, false)); }
/** * Constructor * * @param type The type of the bean * @param beanManager The Bean manager */ protected ManagedBean(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, BeanIdentifier identifier, BeanManagerImpl beanManager) { super(attributes, type, identifier, beanManager); this.proxiable = Proxies.isTypesProxyable(getTypes(), beanManager.getServices()); setProducer(beanManager.getLocalInjectionTargetFactory(getEnhancedAnnotated()).createInjectionTarget(getEnhancedAnnotated(), this, false)); }
private void initPassivationCapable() { this.passivationCapableBean = getEnhancedAnnotated().isSerializable(); this.passivationCapableDependency = isNormalScoped() || (isDependent() && passivationCapableBean); }
private void initPassivationCapable() { this.passivationCapableBean = getEnhancedAnnotated().isSerializable(); this.passivationCapableDependency = isNormalScoped() || (isDependent() && passivationCapableBean); }
/** * Constructor * * @param type The type of the bean * @param beanManager The Bean manager */ protected ManagedBean(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, BeanIdentifier identifier, BeanManagerImpl beanManager) { super(attributes, type, identifier, beanManager); this.proxiable = Proxies.isTypesProxyable(getTypes(), beanManager.getServices()); setProducer(beanManager.getLocalInjectionTargetFactory(getEnhancedAnnotated()).createInjectionTarget(getEnhancedAnnotated(), this, false)); }
private void initPassivationCapable() { this.passivationCapableBean = getEnhancedAnnotated().isSerializable(); this.passivationCapableDependency = isNormalScoped() || (isDependent() && passivationCapableBean); }
private void initPassivationCapable() { this.passivationCapableBean = getEnhancedAnnotated().isSerializable(); this.passivationCapableDependency = isNormalScoped() || (isDependent() && passivationCapableBean); }
@Override protected void checkBeanImplementation() { super.checkBeanImplementation(); if (isNormalScoped()) { for (EnhancedAnnotatedField<?, ?> field : getEnhancedAnnotated().getEnhancedFields()) { if (field.isPublic() && !field.isStatic()) { throw BeanLogger.LOG.publicFieldOnNormalScopedBeanNotAllowed(field); } } } }
@Override protected void checkBeanImplementation() { super.checkBeanImplementation(); if (isNormalScoped()) { for (EnhancedAnnotatedField<?, ?> field : getEnhancedAnnotated().getEnhancedFields()) { if (field.isPublic() && !field.isStatic()) { throw BeanLogger.LOG.publicFieldOnNormalScopedBeanNotAllowed(field); } } } }
@Override protected void checkBeanImplementation() { super.checkBeanImplementation(); if (isNormalScoped()) { for (EnhancedAnnotatedField<?, ?> field : getEnhancedAnnotated().getEnhancedFields()) { if (field.isPublic() && !field.isStatic()) { throw BeanLogger.LOG.publicFieldOnNormalScopedBeanNotAllowed(field); } } } }
@Override protected void checkBeanImplementation() { super.checkBeanImplementation(); if (isNormalScoped()) { for (EnhancedAnnotatedField<?, ?> field : getEnhancedAnnotated().getEnhancedFields()) { if (field.isPublic() && !field.isStatic()) { throw BeanLogger.LOG.publicFieldOnNormalScopedBeanNotAllowed(field); } } } }
@Override protected void checkBeanImplementation() { super.checkBeanImplementation(); if (isNormalScoped()) { for (EnhancedAnnotatedField<?, ?> field : getEnhancedAnnotated().getEnhancedFields()) { if (field.isPublic() && !field.isStatic()) { throw BeanLogger.LOG.publicFieldOnNormalScopedBeanNotAllowed(field); } } } }
@Override protected void checkBeanImplementation() { super.checkBeanImplementation(); if (isNormalScoped()) { for (EnhancedAnnotatedField<?, ?> field : getEnhancedAnnotated().getEnhancedFields()) { if (field.isPublic() && !field.isStatic()) { throw BeanLogger.LOG.publicFieldOnNormalScopedBeanNotAllowed(field); } } } }
/** * Validates the type */ @Override protected void checkType() { if (!isDependent() && getEnhancedAnnotated().isParameterizedType()) { throw BeanLogger.LOG.managedBeanWithParameterizedBeanClassMustBeDependent(type); } boolean passivating = beanManager.isPassivatingScope(getScope()); if (passivating && !isPassivationCapableBean()) { if (!getEnhancedAnnotated().isSerializable()) { throw BeanLogger.LOG.passivatingBeanNeedsSerializableImpl(this); } else if (hasDecorators() && !allDecoratorsArePassivationCapable()) { throw BeanLogger.LOG.passivatingBeanHasNonPassivationCapableDecorator(this, getFirstNonPassivationCapableDecorator()); } else if (hasInterceptors() && !allInterceptorsArePassivationCapable()) { throw BeanLogger.LOG.passivatingBeanHasNonPassivationCapableInterceptor(this, getFirstNonPassivationCapableInterceptor()); } } }
/** * Validates the type */ @Override protected void checkType() { if (!isDependent() && getEnhancedAnnotated().isParameterizedType()) { throw BeanLogger.LOG.managedBeanWithParameterizedBeanClassMustBeDependent(type); } boolean passivating = beanManager.isPassivatingScope(getScope()); if (passivating && !isPassivationCapableBean()) { if (!getEnhancedAnnotated().isSerializable()) { throw BeanLogger.LOG.passivatingBeanNeedsSerializableImpl(this); } else if (hasDecorators() && !allDecoratorsArePassivationCapable()) { throw BeanLogger.LOG.passivatingBeanHasNonPassivationCapableDecorator(this, getFirstNonPassivationCapableDecorator()); } else if (hasInterceptors() && !allInterceptorsArePassivationCapable()) { throw BeanLogger.LOG.passivatingBeanHasNonPassivationCapableInterceptor(this, getFirstNonPassivationCapableInterceptor()); } } }