}
private void validate(Set<Bean<?>> beans)
{
InjectionResolver resolver = ManagerImpl.getManager().getInjectionResolver();
if (beans != null && beans.size() > 0)
{
for (Bean<?> bean : beans)
{
//Bean injection points
Set<InjectionPoint> injectionPoints = bean.getInjectionPoints();
for (InjectionPoint injectionPoint : injectionPoints)
{
//Check for correct injection type
resolver.checkInjectionPointType(injectionPoint);
Class<?> rawType = getRawTypeForInjectionPoint(injectionPoint);
//Comment out while testing TCK Events Test --- WBTCK27 jira./////
//Hack for EntityManager --> Solve in M3!!!!
if(rawType.equals(Event.class) || rawType.getSimpleName().equals("EntityManager"))
{
continue;
}
/////////////////////////////////////////////////////////////////
// check for InjectionPoint injection
if (rawType.equals(InjectionPoint.class))
{
if (injectionPoint.getAnnotations().length == 1 && injectionPoint.getAnnotations()[0].annotationType().equals(Current.class))
{
if (!bean.getScopeType().equals(Dependent.class))
{
throw new WebBeansConfigurationException("Bean " + bean + "scope can not define other scope except @Dependent to inject InjectionPoint");
}
}
}
else
{
resolver.checkInjectionPoints(injectionPoint);
}
}
}
}