}
// check if there are any eager beans
if (!eagerBeans.isEmpty())
{
ManagedBeanBuilder managedBeanBuilder = new ManagedBeanBuilder();
Map<String, Object> applicationMap = externalContext.getApplicationMap();
for (ManagedBean bean : eagerBeans)
{
// check application scope for bean instance
if (applicationMap.containsKey(bean.getManagedBeanName()))
{
// do not build bean, because it already exists
// (e.g. @ManagedProperty from previous managed bean already created it)
continue;
}
// create instance
Object beanInstance = managedBeanBuilder.buildManagedBean(facesContext, bean);
// put in application scope
applicationMap.put(bean.getManagedBeanName(), beanInstance);
}
}