{
throw new WebBeansConfigurationException("ManagedBean implementation class : " + clazz.getName() + " may not _defined as interface");
}
ManagedBean<T> component = new ManagedBean<T>(clazz, type, webBeansContext);
manager.putInjectionTargetWrapper(component, new InjectionTargetWrapper(new InjectionTargetProducer(component)));
webBeansContext.getWebBeansUtil().setInjectionTargetBeanEnableFlag(component);
definitionUtil.defineSerializable(component);
definitionUtil.defineStereoTypes(component, clazz.getDeclaredAnnotations());
Annotation[] clazzAnns = clazz.getDeclaredAnnotations();
definitionUtil.defineApiTypes(component, clazz);
definitionUtil.defineScopeType(component, clazzAnns, "Simple WebBean Component implementation class : " + clazz.getName()
+ " stereotypes must declare same @Scope annotations", false);
// we fully initialize the bean in this case.
component.setFullInit(true);
WebBeansUtil.checkGenericType(component);
definitionUtil.defineQualifiers(component, clazzAnns);
definitionUtil.defineName(component, clazzAnns, WebBeansUtil.getManagedBeanDefaultName(clazz.getSimpleName()));
Constructor<T> constructor = webBeansContext.getWebBeansUtil().defineConstructor(clazz);
component.setConstructor(constructor);
definitionUtil.addConstructorInjectionPointMetaData(component, constructor);
//Dropped from the speicification
//WebBeansUtil.checkSteroTypeRequirements(component, clazz.getDeclaredAnnotations(), "Simple WebBean Component implementation class : " + clazz.getName());
Set<ProducerMethodBean<?>> producerMethods = definitionUtil.defineProducerMethods(component);
for (ProducerMethodBean<?> producerMethod : producerMethods)
{
// add them one after the other to enable serialization handling et al
manager.addBean(producerMethod);
manager.putInjectionTargetWrapper(producerMethod, new InjectionTargetWrapper(new ProducerBeansProducer(producerMethod)));
}
Set<ProducerFieldBean<?>> producerFields = definitionUtil.defineProducerFields(component);
for (ProducerFieldBean<?> producerField : producerFields)
{
// add them one after the other to enable serialization handling et al
manager.addBean(producerField);
manager.putInjectionTargetWrapper(producerField, new InjectionTargetWrapper(new ProducerBeansProducer(producerField)));
}
definitionUtil.defineDisposalMethods(component);
definitionUtil.defineInjectedFields(component);