List of usage examples for org.springframework.beans.factory.annotation AnnotatedBeanDefinition getFactoryMethodMetadata
@Nullable MethodMetadata getFactoryMethodMetadata();
From source file:org.joinfaces.annotations.JsfCdiToSpringBeanFactoryPostProcessor.java
/** * Checks how is bean defined and deduces scope name from JSF CDI annotations. * * @param definition beanDefinition/*from w ww. jav a2 s . c o m*/ */ private void registerJsfCdiToSpring(BeanDefinition definition) { if (definition instanceof AnnotatedBeanDefinition) { AnnotatedBeanDefinition annDef = (AnnotatedBeanDefinition) definition; String scopeName = null; // firstly check whether bean is defined via configuration if (annDef.getFactoryMethodMetadata() != null) { scopeName = JsfCdiToSpring.deduceScopeName(annDef.getFactoryMethodMetadata()); } else { // fallback to type scopeName = JsfCdiToSpring.deduceScopeName(annDef.getMetadata().getAnnotationTypes()); } if (scopeName != null) { definition.setScope(scopeName); logger.debug( definition.getBeanClassName() + " - Scope(" + definition.getScope().toUpperCase() + ")"); } } }