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| 限定符和类型 | 字段和说明 |
|---|---|
static String |
BEAN_NAME
The bean name of
ReferenceAnnotationBeanPostProcessor |
| 构造器和说明 |
|---|
ReferenceAnnotationBeanPostProcessor()
@com.alibaba.dubbo.config.annotation.Reference has been supported since 2.7.3
@DubboReference has been supported since 2.7.7 |
| 限定符和类型 | 方法和说明 |
|---|---|
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()
已过时。
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 在接口中 org.springframework.beans.factory.config.BeanFactoryPostProcessororg.springframework.beans.BeansExceptionpublic void postProcessMergedBeanDefinition(org.springframework.beans.factory.support.RootBeanDefinition beanDefinition,
Class<?> beanType,
String beanName)
postProcessMergedBeanDefinition 在接口中 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 在接口中 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 在接口中 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 在接口中 org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic void destroy()
throws Exception
destroy 在接口中 org.springframework.beans.factory.DisposableBeandestroy 在类中 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–2022 The Apache Software Foundation. All rights reserved.