}
public <T> BeanAttributes<T> fireProcessBeanAttributes(final AnnotatedType<T> annotatedType, final Class<?> type, final BeanAttributes<T> ba)
{
// we don't use bm stack since it is actually quite useless
final ProcessBeanAttributesImpl event = new GProcessBeanAttributes(type, annotatedType, ba);
try
{
webBeansContext.getBeanManagerImpl().fireEvent(event, true, AnnotationUtil.EMPTY_ANNOTATION_ARRAY);
}
catch (final Exception e)
{
throw new DefinitionException("event ProcessBeanAttributes thrown an exception for " + annotatedType, e);
}
if (event.getDefinitionError() != null)
{
throw new DefinitionException(event.getDefinitionError());
}
final BeanAttributes<T> beanAttributes;
if (event.getAttributes() != ba)
{
beanAttributes = event.getAttributes();
if (!webBeansContext.getBeanManagerImpl().isScope(beanAttributes.getScope()))
{
throw new DefinitionException(beanAttributes.getScope() + " is not a scope");
}
}
else
{
beanAttributes = ba;
}
if (event.isVeto())
{
return null;
}
return beanAttributes;
}