@SuppressWarnings({ "rawtypes", "unchecked" }) private static void doDefineNewManagedBean(BeanManagerImpl beanManager, String bdaId, Class<?> beanClass) { try { ClassTransformer classTransformer = getClassTransformer(); SlimAnnotatedType<?> annotatedType = classTransformer.getBackedAnnotatedType(beanClass, bdaId); boolean managedBeanOrDecorator = Beans.isTypeManagedBeanOrDecoratorOrInterceptor(annotatedType); if (managedBeanOrDecorator) { EnhancedAnnotatedType eat = EnhancedAnnotatedTypeImpl.of(annotatedType, classTransformer); BeanAttributes attributes = BeanAttributesFactory.forBean(eat, beanManager); ManagedBean<?> bean = ManagedBean.of(attributes, eat, beanManager); ReflectionHelper.set(beanManager, beanManager.getClass(), "beanSet", Collections.synchronizedSet(new HashSet<Bean<?>>())); beanManager.addBean(bean); beanManager.getBeanResolver().clear(); bean.initializeAfterBeanDiscovery(); LOGGER.debug("Bean defined '{}'", beanClass.getName()); } else { // TODO : define session bean LOGGER.warning("Bean NOT? defined '{}', session bean?", beanClass.getName()); } } catch (Exception e) { LOGGER.debug("Bean definition failed.", e); } }
if (Beans.isTypeManagedBeanOrDecoratorOrInterceptor(classFileInfo, checkTypeModifiers)) { return createContext(className, classFileInfo, observerMethods, bdaId);
if (Beans.isTypeManagedBeanOrDecoratorOrInterceptor(classFileInfo, checkTypeModifiers)) { return createContext(className, classFileInfo, observerMethods, bdaId);
if (Beans.isTypeManagedBeanOrDecoratorOrInterceptor(classFileInfo, checkTypeModifiers)) { return createContext(className, classFileInfo, observerMethods, bdaId);
if (Beans.isTypeManagedBeanOrDecoratorOrInterceptor(classFileInfo, checkTypeModifiers)) { return createContext(className, classFileInfo, observerMethods, bdaId);
if (Beans.isTypeManagedBeanOrDecoratorOrInterceptor(classFileInfo, checkTypeModifiers)) { return createContext(className, classFileInfo, observerMethods, bdaId);
if (Beans.isTypeManagedBeanOrDecoratorOrInterceptor(classFileInfo, checkTypeModifiers)) { return createContext(className, classFileInfo, observerMethods, bdaId);
protected void createClassBean(SlimAnnotatedType<?> annotatedType, SetMultimap<Class<?>, SlimAnnotatedType<?>> otherWeldClasses) { boolean managedBeanOrDecorator = !ejbSupport.isEjb(annotatedType.getJavaClass()) && Beans.isTypeManagedBeanOrDecoratorOrInterceptor(annotatedType); if (managedBeanOrDecorator) { containerLifecycleEvents.preloadProcessInjectionTarget(annotatedType.getJavaClass()); containerLifecycleEvents.preloadProcessBeanAttributes(annotatedType.getJavaClass()); EnhancedAnnotatedType<?> weldClass = classTransformer.getEnhancedAnnotatedType(annotatedType); if (weldClass.isAnnotationPresent(Decorator.class)) { containerLifecycleEvents.preloadProcessBean(ProcessBean.class, annotatedType.getJavaClass()); validateDecorator(weldClass); createDecorator(weldClass); } else if (weldClass.isAnnotationPresent(Interceptor.class)) { containerLifecycleEvents.preloadProcessBean(ProcessBean.class, annotatedType.getJavaClass()); validateInterceptor(weldClass); createInterceptor(weldClass); } else if (!weldClass.isAbstract()) { containerLifecycleEvents.preloadProcessBean(ProcessManagedBean.class, annotatedType.getJavaClass()); createManagedBean(weldClass); } } else { if (Beans.isDecoratorDeclaringInAppropriateConstructor(annotatedType)) { BootstrapLogger.LOG.decoratorWithNonCdiConstructor(annotatedType.getJavaClass().getName()); } Class<? extends Annotation> scopeClass = Beans.getBeanDefiningAnnotationScope(annotatedType); if (scopeClass != null && !Beans.hasSimpleCdiConstructor(annotatedType)) { BootstrapLogger.LOG.annotatedTypeNotRegisteredAsBeanDueToMissingAppropriateConstructor(annotatedType.getJavaClass().getName(), scopeClass.getSimpleName()); } otherWeldClasses.put(annotatedType.getJavaClass(), annotatedType); } }
protected void createClassBean(SlimAnnotatedType<?> annotatedType, SetMultimap<Class<?>, SlimAnnotatedType<?>> otherWeldClasses) { boolean managedBeanOrDecorator = !ejbSupport.isEjb(annotatedType.getJavaClass()) && Beans.isTypeManagedBeanOrDecoratorOrInterceptor(annotatedType); if (managedBeanOrDecorator) { containerLifecycleEvents.preloadProcessInjectionTarget(annotatedType.getJavaClass()); containerLifecycleEvents.preloadProcessBeanAttributes(annotatedType.getJavaClass()); EnhancedAnnotatedType<?> weldClass = classTransformer.getEnhancedAnnotatedType(annotatedType); if (weldClass.isAnnotationPresent(Decorator.class)) { containerLifecycleEvents.preloadProcessBean(ProcessBean.class, annotatedType.getJavaClass()); validateDecorator(weldClass); createDecorator(weldClass); } else if (weldClass.isAnnotationPresent(Interceptor.class)) { containerLifecycleEvents.preloadProcessBean(ProcessBean.class, annotatedType.getJavaClass()); validateInterceptor(weldClass); createInterceptor(weldClass); } else if (!weldClass.isAbstract()) { containerLifecycleEvents.preloadProcessBean(ProcessManagedBean.class, annotatedType.getJavaClass()); createManagedBean(weldClass); } } else { if (Beans.isDecoratorDeclaringInAppropriateConstructor(annotatedType)) { BootstrapLogger.LOG.decoratorWithNonCdiConstructor(annotatedType.getJavaClass().getName()); } Class<? extends Annotation> scopeClass = Beans.getBeanDefiningAnnotationScope(annotatedType); if (scopeClass != null && !Beans.hasSimpleCdiConstructor(annotatedType)) { BootstrapLogger.LOG.annotatedTypeNotRegisteredAsBeanDueToMissingAppropriateConstructor(annotatedType.getJavaClass().getName(), scopeClass.getSimpleName()); } otherWeldClasses.put(annotatedType.getJavaClass(), annotatedType); } }
protected void createClassBean(SlimAnnotatedType<?> annotatedType, SetMultimap<Class<?>, SlimAnnotatedType<?>> otherWeldClasses) { boolean managedBeanOrDecorator = !ejbSupport.isEjb(annotatedType.getJavaClass()) && Beans.isTypeManagedBeanOrDecoratorOrInterceptor(annotatedType); if (managedBeanOrDecorator) { containerLifecycleEvents.preloadProcessInjectionTarget(annotatedType.getJavaClass()); containerLifecycleEvents.preloadProcessBeanAttributes(annotatedType.getJavaClass()); EnhancedAnnotatedType<?> weldClass = classTransformer.getEnhancedAnnotatedType(annotatedType); if (weldClass.isAnnotationPresent(Decorator.class)) { containerLifecycleEvents.preloadProcessBean(ProcessBean.class, annotatedType.getJavaClass()); validateDecorator(weldClass); createDecorator(weldClass); } else if (weldClass.isAnnotationPresent(Interceptor.class)) { containerLifecycleEvents.preloadProcessBean(ProcessBean.class, annotatedType.getJavaClass()); validateInterceptor(weldClass); createInterceptor(weldClass); } else if (!weldClass.isAbstract()) { containerLifecycleEvents.preloadProcessBean(ProcessManagedBean.class, annotatedType.getJavaClass()); createManagedBean(weldClass); } } else { if (Beans.isDecoratorDeclaringInAppropriateConstructor(annotatedType)) { BootstrapLogger.LOG.decoratorWithNonCdiConstructor(annotatedType.getJavaClass().getName()); } Class<? extends Annotation> scopeClass = Beans.getBeanDefiningAnnotationScope(annotatedType); if (scopeClass != null && !Beans.hasSimpleCdiConstructor(annotatedType)) { BootstrapLogger.LOG.annotatedTypeNotRegisteredAsBeanDueToMissingAppropriateConstructor(annotatedType.getJavaClass().getName(), scopeClass.getSimpleName()); } otherWeldClasses.put(annotatedType.getJavaClass(), annotatedType); } }
protected void createClassBean(SlimAnnotatedType<?> annotatedType, SetMultimap<Class<?>, SlimAnnotatedType<?>> otherWeldClasses) { boolean managedBeanOrDecorator = !ejbSupport.isEjb(annotatedType.getJavaClass()) && Beans.isTypeManagedBeanOrDecoratorOrInterceptor(annotatedType); if (managedBeanOrDecorator) { containerLifecycleEvents.preloadProcessInjectionTarget(annotatedType.getJavaClass()); containerLifecycleEvents.preloadProcessBeanAttributes(annotatedType.getJavaClass()); EnhancedAnnotatedType<?> weldClass = classTransformer.getEnhancedAnnotatedType(annotatedType); if (weldClass.isAnnotationPresent(Decorator.class)) { containerLifecycleEvents.preloadProcessBean(ProcessBean.class, annotatedType.getJavaClass()); validateDecorator(weldClass); createDecorator(weldClass); } else if (weldClass.isAnnotationPresent(Interceptor.class)) { containerLifecycleEvents.preloadProcessBean(ProcessBean.class, annotatedType.getJavaClass()); validateInterceptor(weldClass); createInterceptor(weldClass); } else if (!weldClass.isAbstract()) { containerLifecycleEvents.preloadProcessBean(ProcessManagedBean.class, annotatedType.getJavaClass()); createManagedBean(weldClass); } } else { if (Beans.isDecoratorDeclaringInAppropriateConstructor(annotatedType)) { BootstrapLogger.LOG.decoratorWithNonCdiConstructor(annotatedType.getJavaClass().getName()); } Class<? extends Annotation> scopeClass = Beans.getBeanDefiningAnnotationScope(annotatedType); if (scopeClass != null && !Beans.hasSimpleCdiConstructor(annotatedType)) { BootstrapLogger.LOG.annotatedTypeNotRegisteredAsBeanDueToMissingAppropriateConstructor(annotatedType.getJavaClass().getName(), scopeClass.getSimpleName()); } otherWeldClasses.put(annotatedType.getJavaClass(), annotatedType); } }
protected void createClassBean(SlimAnnotatedType<?> annotatedType, SetMultimap<Class<?>, SlimAnnotatedType<?>> otherWeldClasses) { boolean managedBeanOrDecorator = !ejbSupport.isEjb(annotatedType.getJavaClass()) && Beans.isTypeManagedBeanOrDecoratorOrInterceptor(annotatedType); if (managedBeanOrDecorator) { containerLifecycleEvents.preloadProcessInjectionTarget(annotatedType.getJavaClass()); containerLifecycleEvents.preloadProcessBeanAttributes(annotatedType.getJavaClass()); EnhancedAnnotatedType<?> weldClass = classTransformer.getEnhancedAnnotatedType(annotatedType); if (weldClass.isAnnotationPresent(Decorator.class)) { containerLifecycleEvents.preloadProcessBean(ProcessBean.class, annotatedType.getJavaClass()); validateDecorator(weldClass); createDecorator(weldClass); } else if (weldClass.isAnnotationPresent(Interceptor.class)) { containerLifecycleEvents.preloadProcessBean(ProcessBean.class, annotatedType.getJavaClass()); validateInterceptor(weldClass); createInterceptor(weldClass); } else if (!weldClass.isAbstract()) { containerLifecycleEvents.preloadProcessBean(ProcessManagedBean.class, annotatedType.getJavaClass()); createManagedBean(weldClass); } } else { if (Beans.isDecoratorDeclaringInAppropriateConstructor(annotatedType)) { BootstrapLogger.LOG.decoratorWithNonCdiConstructor(annotatedType.getJavaClass().getName()); } Class<? extends Annotation> scopeClass = Beans.getBeanDefiningAnnotationScope(annotatedType); if (scopeClass != null && !Beans.hasSimpleCdiConstructor(annotatedType)) { BootstrapLogger.LOG.annotatedTypeNotRegisteredAsBeanDueToMissingAppropriateConstructor(annotatedType.getJavaClass().getName(), scopeClass.getSimpleName()); } otherWeldClasses.put(annotatedType.getJavaClass(), annotatedType); } }
protected void createClassBean(SlimAnnotatedType<?> annotatedType, SetMultimap<Class<?>, SlimAnnotatedType<?>> otherWeldClasses) { boolean managedBeanOrDecorator = !getEnvironment().getEjbDescriptors().contains(annotatedType.getJavaClass()) && Beans.isTypeManagedBeanOrDecoratorOrInterceptor(annotatedType); if (managedBeanOrDecorator) { containerLifecycleEvents.preloadProcessInjectionTarget(annotatedType.getJavaClass());