}
BeanManagerImpl beanManager = webBeansContext.getBeanManagerImpl();
//Fires ProcessManagedBean
ProcessBeanImpl<T> processBeanEvent = new GProcessManagedBean(managedBean, annotatedType);
beanManager.fireEvent(processBeanEvent);
inspectErrorStack("There are errors that are added by ProcessManagedBean event observers for " +
"managed beans. Look at logs for further details");
//Fires ProcessProducerMethod
fireProcessProducerMethodBeanEvent(annotatedMethods, annotatedType);
inspectErrorStack("There are errors that are added by ProcessProducerMethod event observers for " +
"producer method beans. Look at logs for further details");
//Fires ProcessProducerField
fireProcessProducerFieldBeanEvent(annotatedFields);
inspectErrorStack("There are errors that are added by ProcessProducerField event observers for " +
"producer field beans. Look at logs for further details");
//Fire ObservableMethods
fireProcessObservableMethodBeanEvent(observerMethodsMap);
inspectErrorStack("There are errors that are added by ProcessObserverMethod event observers for " +
"observer methods. Look at logs for further details");
if(!isAnnotatedTypeDecoratorOrInterceptor(annotatedType))
{
beanManager.addBean(WebBeansUtil.createNewBean(managedBean));
beanManager.addBean(managedBean);
for (ProducerMethodBean<?> producerMethod : producerMethods)
{
// add them one after the other to enable serialization handling et al
beanManager.addBean(producerMethod);
}
managedBeanCreator.defineDisposalMethods();//Define disposal method after adding producers
for (ProducerFieldBean<?> producerField : producerFields)
{
// add them one after the other to enable serialization handling et al
beanManager.addBean(producerField);
}
}
}
else
{
// we still need to fire a ProcessManagedBean event, even for lazily initiated beans
// (which most probably are no beans at all...)
BeanManagerImpl beanManager = webBeansContext.getBeanManagerImpl();
//Fires ProcessManagedBean
ProcessBeanImpl<T> processBeanEvent = new GProcessManagedBean(managedBean, annotatedType);
beanManager.fireEvent(processBeanEvent);
inspectErrorStack("There are errors that are added by ProcessManagedBean event observers for " +
"managed beans. Look at logs for further details");
if(!isAnnotatedTypeDecoratorOrInterceptor(annotatedType))
{