if (webBeansContext.getManagedBeanConfigurator().isManagedBean(clazz))
{
comp = new NewBean<T>(clazz, WebBeansType.MANAGED, webBeansContext);
comp.setImplScopeType(new DependentScopeLiteral());
comp.setConstructor(defineConstructor(clazz));
definitionUtil.addConstructorInjectionPointMetaData(comp, comp.getConstructor());
definitionUtil.defineInjectedFields(comp);
definitionUtil.defineInjectedMethods(comp);
}
else if (EJBWebBeansConfigurator.isSessionBean(clazz, webBeansContext))
{
comp = new NewBean<T>(clazz, WebBeansType.ENTERPRISE, webBeansContext);
comp.setImplScopeType(new DependentScopeLiteral());
}
else
{
throw new WebBeansConfigurationException("@New annotation on type : " + clazz.getName()
+ " must defined as a simple or an enterprise web bean");