Package com.alibaba.nacos.sys.env
Class AbstractNacosDuplicateBeanPostProcessor
java.lang.Object
com.alibaba.nacos.sys.env.AbstractNacosDuplicateBeanPostProcessor
- All Implemented Interfaces:
org.springframework.beans.factory.config.BeanPostProcessor,org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor
- Direct Known Subclasses:
NacosDuplicateConfigurationBeanPostProcessor,NacosDuplicateSpringBeanPostProcessor
public abstract class AbstractNacosDuplicateBeanPostProcessor
extends Object
implements org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor
Abstract Nacos Duplicate Bean Post Processor of
InstantiationAwareBeanPostProcessor to reduce duplicate rebuild bean for spring beans.- Author:
- xiweng.yy
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractNacosDuplicateBeanPostProcessor(org.springframework.context.ConfigurableApplicationContext context) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleanisReUsingBean(Class<?> beanClass, String beanName, org.springframework.beans.factory.config.BeanDefinition beanDefinition) Judge whether re-use beans from core context.postProcessBeforeInstantiation(Class<?> beanClass, String beanName) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.config.BeanPostProcessor
postProcessAfterInitialization, postProcessBeforeInitializationMethods inherited from interface org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor
postProcessAfterInstantiation, postProcessProperties
-
Constructor Details
-
AbstractNacosDuplicateBeanPostProcessor
protected AbstractNacosDuplicateBeanPostProcessor(org.springframework.context.ConfigurableApplicationContext context)
-
-
Method Details
-
postProcessBeforeInstantiation
public Object postProcessBeforeInstantiation(Class<?> beanClass, String beanName) throws org.springframework.beans.BeansException - Specified by:
postProcessBeforeInstantiationin interfaceorg.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor- Throws:
org.springframework.beans.BeansException
-
isReUsingBean
protected abstract boolean isReUsingBean(Class<?> beanClass, String beanName, org.springframework.beans.factory.config.BeanDefinition beanDefinition) Judge whether re-use beans from core context.- Parameters:
beanClass- bean classbeanName- bean namebeanDefinition- bean definition- Returns:
truemeans re-use beans from core context, otherwisefalsemeans to re-build bean in sub context.
-