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