private static void doReloadBeanInBeanContexts(BeanManagerImpl beanManager, ManagedBean<?> managedBean) { try { Map<Class<? extends Annotation>, List<Context>> contexts = getContextMap(beanManager); List<Context> ctxList = contexts.get(managedBean.getScope()); if (ctxList != null) { for(Context context: ctxList) { doReloadBeanInContext(beanManager, managedBean, context); } } else { LOGGER.debug("No active contexts for bean '{}' in scope '{}'", managedBean.getBeanClass().getName(), managedBean.getScope()); } } catch (Exception e) { if (e.getClass().getSimpleName().equals("ContextNotActiveException")) { LOGGER.warning("No active contexts for bean '{}'", e, managedBean.getBeanClass().getName()); } else { LOGGER.warning("Context for '{}' failed to reload", e, managedBean.getBeanClass().getName()); } } }
/** * 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()); } } }
/** * 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()); } } }
/** * 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()); } } }