if (!found)
{
Set<Class<? extends Annotation>> stereos = component.getStereotypes();
if (stereos.size() == 0)
{
component.setImplScopeType(new DependentScopeLiteral());
if (allowLazyInit && component instanceof ManagedBean && isPurePojoBean(component.getWebBeansContext(), component.getBeanClass()))
{
// take the bean as Dependent but we could lazily initialize it
// because the bean doesn't contains any CDI feature
((ManagedBean) component).setFullInit(false);
}
}
else
{
Annotation defined = null;
Set<Class<? extends Annotation>> anns = component.getStereotypes();
for (Class<? extends Annotation> stero : anns)
{
boolean containsNormal = AnnotationUtil.hasMetaAnnotation(stero.getDeclaredAnnotations(), NormalScope.class);
if (AnnotationUtil.hasMetaAnnotation(stero.getDeclaredAnnotations(), NormalScope.class) ||
AnnotationUtil.hasMetaAnnotation(stero.getDeclaredAnnotations(), Scope.class))
{
Annotation next;
if(containsNormal)
{
next = AnnotationUtil.getMetaAnnotations(stero.getDeclaredAnnotations(), NormalScope.class)[0];
}
else
{
next = AnnotationUtil.getMetaAnnotations(stero.getDeclaredAnnotations(), Scope.class)[0];
}
if (defined == null)
{
defined = next;
}
else
{
if (!defined.equals(next))
{
throw new WebBeansConfigurationException(exceptionMessage);
}
}
}
}
if (defined != null)
{
component.setImplScopeType(defined);
}
else
{
component.setImplScopeType(new DependentScopeLiteral());
if (allowLazyInit && component instanceof ManagedBean && isPurePojoBean(component.getWebBeansContext(), component.getBeanClass()))
{
// take the bean as Dependent but we could lazily initialize it
// because the bean doesn't contains any CDI feature