public class ReferenceAnnotationBeanPostProcessor extends AbstractAnnotationBeanPostProcessor implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.config.BeanFactoryPostProcessor
Step 1:
The purpose of implementing BeanFactoryPostProcessor is to scan the registration reference bean definition earlier,
so that it can be shared with the xml bean configuration.
Step 2:
By implementing InstantiationAwareBeanPostProcessor,
inject the reference bean instance into the fields and setter methods which annotated with DubboReference.
DubboReference,
Reference,
com.alibaba.dubbo.config.annotation.ReferenceAbstractAnnotationBeanPostProcessor.AnnotatedFieldElement| Modifier and Type | Field and Description |
|---|---|
static String |
BEAN_NAME
The bean name of
ReferenceAnnotationBeanPostProcessor |
| Constructor and Description |
|---|
ReferenceAnnotationBeanPostProcessor()
@com.alibaba.dubbo.config.annotation.Reference has been supported since 2.7.3 |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
Map<org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement,ReferenceBean<?>> |
getInjectedFieldReferenceBeanMap()
Get
ReferenceBean Map in injected field. |
Map<org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement,ReferenceBean<?>> |
getInjectedMethodReferenceBeanMap()
Get
ReferenceBean Map in injected method. |
Collection<ReferenceBean<?>> |
getReferenceBeans()
Deprecated.
use
ReferenceBeanManager.getReferences() instead |
void |
postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) |
void |
postProcessMergedBeanDefinition(org.springframework.beans.factory.support.RootBeanDefinition beanDefinition,
Class<?> beanType,
String beanName) |
org.springframework.beans.PropertyValues |
postProcessProperties(org.springframework.beans.PropertyValues pvs,
Object bean,
String beanName)
Alternatives to the
postProcessPropertyValues(PropertyValues, PropertyDescriptor[], Object, String). |
org.springframework.beans.PropertyValues |
postProcessPropertyValues(org.springframework.beans.PropertyValues pvs,
PropertyDescriptor[] pds,
Object bean,
String beanName)
Alternatives to the
postProcessProperties(PropertyValues, Object, String), that removed as of Spring
Framework 6.0.0, and in favor of postProcessProperties(PropertyValues, Object, String). |
String |
registerReferenceBean(String propertyName,
Class<?> injectedType,
Map<String,Object> attributes,
Member member) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
getAnnotationType, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInitialization, postProcessBeforeInstantiation, setBeanClassLoader, setBeanFactory, setEnvironmentpublic static final String BEAN_NAME
ReferenceAnnotationBeanPostProcessorpublic ReferenceAnnotationBeanPostProcessor()
@com.alibaba.dubbo.config.annotation.Reference has been supported since 2.7.3
@DubboReference has been supported since 2.7.7
public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
throws org.springframework.beans.BeansException
postProcessBeanFactory in interface org.springframework.beans.factory.config.BeanFactoryPostProcessororg.springframework.beans.BeansExceptionpublic void postProcessMergedBeanDefinition(org.springframework.beans.factory.support.RootBeanDefinition beanDefinition,
Class<?> beanType,
String beanName)
postProcessMergedBeanDefinition in interface org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessorpublic org.springframework.beans.PropertyValues postProcessPropertyValues(org.springframework.beans.PropertyValues pvs,
PropertyDescriptor[] pds,
Object bean,
String beanName)
throws org.springframework.beans.BeansException
postProcessProperties(PropertyValues, Object, String), that removed as of Spring
Framework 6.0.0, and in favor of postProcessProperties(PropertyValues, Object, String).
In order to be compatible with the lower version of Spring, it is still retained.
postProcessPropertyValues in interface org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessororg.springframework.beans.BeansExceptionpostProcessProperties(org.springframework.beans.PropertyValues, java.lang.Object, java.lang.String)public org.springframework.beans.PropertyValues postProcessProperties(org.springframework.beans.PropertyValues pvs,
Object bean,
String beanName)
throws org.springframework.beans.BeansException
postProcessPropertyValues(PropertyValues, PropertyDescriptor[], Object, String).postProcessProperties in interface org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessororg.springframework.beans.BeansExceptionpostProcessPropertyValues(org.springframework.beans.PropertyValues, java.beans.PropertyDescriptor[], java.lang.Object, java.lang.String)public String registerReferenceBean(String propertyName, Class<?> injectedType, Map<String,Object> attributes, Member member) throws org.springframework.beans.BeansException
org.springframework.beans.BeansExceptionpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic void destroy()
throws Exception
destroy in interface org.springframework.beans.factory.DisposableBeandestroy in class AbstractAnnotationBeanPostProcessorException@Deprecated public Collection<ReferenceBean<?>> getReferenceBeans()
ReferenceBeanManager.getReferences() insteadReferenceBeanpublic Map<org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement,ReferenceBean<?>> getInjectedFieldReferenceBeanMap()
ReferenceBean Map in injected field.Mappublic Map<org.springframework.beans.factory.annotation.InjectionMetadata.InjectedElement,ReferenceBean<?>> getInjectedMethodReferenceBeanMap()
ReferenceBean Map in injected method.MapCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.