private static EnhancedAnnotatedType<?> createAnnotatedTypeForExistingBeanClass(String bdaId, Bean<?> bean) { ClassTransformer classTransformer = getClassTransformer(); SlimAnnotatedType<?> annotatedType = classTransformer.getBackedAnnotatedType(bean.getBeanClass(), bdaId); return EnhancedAnnotatedTypeImpl.of(annotatedType, classTransformer); }
@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); } }
private <T> SlimAnnotatedType<T> loadSlimAnnotatedType(Class<T> clazz, String bdaId) { if (clazz != null) { try { return classTransformer.getBackedAnnotatedType(clazz, bdaId); } catch (ResourceLoadingException e) { missingDependenciesRegistry.handleResourceLoadingException(clazz.getName(), e); } } return null; } // checking availability of ClassInfo.setFlags method is just workaround for JANDEX-37
@Override public EnhancedAnnotation<?> apply(Class<? extends Annotation> from) { SlimAnnotatedType<? extends Annotation> slimAnnotatedType = syntheticAnnotationsAnnotatedTypes.get(from); if (slimAnnotatedType == null) { // We do not recognize the BDA that defined the annotation This could in theory cause problem is two // annotations with the same name but different definition are defined within the same application (different // BDAs) slimAnnotatedType = getBackedAnnotatedType(from, AnnotatedTypeIdentifier.NULL_BDA_ID); } return EnhancedAnnotationImpl.create(slimAnnotatedType, ClassTransformer.this); } }
private <T> SlimAnnotatedType<T> loadSlimAnnotatedType(Class<T> clazz, String bdaId) { if (clazz != null) { try { return classTransformer.getBackedAnnotatedType(clazz, bdaId); } catch (ResourceLoadingException e) { missingDependenciesRegistry.handleResourceLoadingException(clazz.getName(), e); } } return null; } // checking availability of ClassInfo.setFlags method is just workaround for JANDEX-37
private <T> SlimAnnotatedType<T> loadSlimAnnotatedType(Class<T> clazz, String bdaId) { if (clazz != null) { try { return classTransformer.getBackedAnnotatedType(clazz, bdaId); } catch (ResourceLoadingException e) { missingDependenciesRegistry.handleResourceLoadingException(clazz.getName(), e); } } return null; } // checking availability of ClassInfo.setFlags method is just workaround for JANDEX-37
private <T> SlimAnnotatedType<T> loadSlimAnnotatedType(Class<T> clazz, String bdaId) { if (clazz != null) { try { return classTransformer.getBackedAnnotatedType(clazz, bdaId); } catch (ResourceLoadingException e) { missingDependenciesRegistry.handleResourceLoadingException(clazz.getName(), e); } } return null; } // checking availability of ClassInfo.setFlags method is just workaround for JANDEX-37
@Override public EnhancedAnnotation<?> apply(Class<? extends Annotation> from) { SlimAnnotatedType<? extends Annotation> slimAnnotatedType = syntheticAnnotationsAnnotatedTypes.get(from); if (slimAnnotatedType == null) { // We do not recognize the BDA that defined the annotation This could in theory cause problem is two // annotations with the same name but different definition are defined within the same application (different // BDAs) slimAnnotatedType = getBackedAnnotatedType(from, AnnotatedTypeIdentifier.NULL_BDA_ID); } return EnhancedAnnotationImpl.create(slimAnnotatedType, ClassTransformer.this); } }
@Override protected <T> SlimAnnotatedType<T> loadAnnotatedType(Class<T> clazz, String bdaId) { if (clazz != null) { try { return classTransformer.getBackedAnnotatedType(clazz, bdaId); } catch (ResourceLoadingException e) { missingDependenciesRegistry.handleResourceLoadingException(clazz.getName(), e); } } return null; }
@Override public EnhancedAnnotation<?> apply(Class<? extends Annotation> from) { SlimAnnotatedType<? extends Annotation> slimAnnotatedType = syntheticAnnotationsAnnotatedTypes.get(from); if (slimAnnotatedType == null) { // We do not recognize the BDA that defined the annotation This could in theory cause problem is two // annotations with the same name but different definition are defined within the same application (different // BDAs) slimAnnotatedType = getBackedAnnotatedType(from, AnnotatedTypeIdentifier.NULL_BDA_ID); } return EnhancedAnnotationImpl.create(slimAnnotatedType, ClassTransformer.this); } }
@Override public <T> AnnotatedType<T> createAnnotatedType(Class<T> type) { // first, make sure to use the right BDA ID for this class String bdaId = BeanManagerLookupService.lookupBeanManager(type, this).getId(); return getServices().get(ClassTransformer.class).getBackedAnnotatedType(type, bdaId); }
@Override public <T> AnnotatedType<T> createAnnotatedType(Class<T> type) { // first, make sure to use the right BDA ID for this class String bdaId = BeanManagerLookupService.lookupBeanManager(type, this).getId(); return getServices().get(ClassTransformer.class).getBackedAnnotatedType(type, bdaId); }
@Override public <T> AnnotatedType<T> createAnnotatedType(Class<T> type) { // first, make sure to use the right BDA ID for this class String bdaId = BeanManagerLookupService.lookupBeanManager(type, this).getId(); return getServices().get(ClassTransformer.class).getBackedAnnotatedType(type, bdaId); }
@Override public <T> AnnotatedType<T> createAnnotatedType(Class<T> type, String id) { return getServices().get(ClassTransformer.class).getBackedAnnotatedType(type, BeanManagerLookupService.lookupBeanManager(type, this).getId(), id); }
@Override public <T> AnnotatedType<T> createAnnotatedType(Class<T> type, String id) { return getServices().get(ClassTransformer.class).getBackedAnnotatedType(type, BeanManagerLookupService.lookupBeanManager(type, this).getId(), id); }
@Override public <T> AnnotatedType<T> createAnnotatedType(Class<T> type) { // first, make sure to use the right BDA ID for this class String bdaId = BeanManagerLookupService.lookupBeanManager(type, this).getId(); return getServices().get(ClassTransformer.class).getBackedAnnotatedType(type, bdaId); }
@Override public <T> AnnotatedType<T> createAnnotatedType(Class<T> type) { // first, make sure to use the right BDA ID for this class String bdaId = BeanManagerLookupService.lookupBeanManager(type, this).getId(); return getServices().get(ClassTransformer.class).getBackedAnnotatedType(type, bdaId); }
@Override public <T> AnnotatedType<T> createAnnotatedType(Class<T> type) { // first, make sure to use the right BDA ID for this class String bdaId = BeanManagerLookupService.lookupBeanManager(type, this).getId(); return getServices().get(ClassTransformer.class).getBackedAnnotatedType(type, bdaId); }
@Override public <T> AnnotatedType<T> createAnnotatedType(Class<T> type, String id) { return getServices().get(ClassTransformer.class).getBackedAnnotatedType(type, BeanManagerLookupService.lookupBeanManager(type, this).getId(), id); }
protected <T> SessionBean<T> createSessionBean(InternalEjbDescriptor<T> descriptor, BeanDeployerEnvironment environment, BeanManagerImpl manager, ClassTransformer transformer) { final SlimAnnotatedType<T> type = transformer.getBackedAnnotatedType(descriptor.getBeanClass(), manager.getId()); manager.getServices().get(SlimAnnotatedTypeStore.class).put(type); return createSessionBean(descriptor, type, environment, manager, transformer); }