use of org.jboss.weld.context.ContextNotActiveException in project HotswapAgent by HotswapProjects.
the class BeanReloadExecutor method doReloadBeanInBeanContexts.
private static void doReloadBeanInBeanContexts(BeanManagerImpl beanManager, Class<?> beanClass, 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, beanClass, managedBean, context);
}
} else {
LOGGER.debug("No active contexts for bean '{}' in scope '{}'", beanClass.getName(), managedBean.getScope());
}
} catch (ContextNotActiveException e) {
LOGGER.warning("No active contexts for bean '{}'", e, beanClass.getName());
} catch (Exception e) {
LOGGER.warning("Context for '{}' failed to reload", e, beanClass.getName());
}
}
Aggregations