Class NacosDuplicateSpringBeanPostProcessor

java.lang.Object
com.alibaba.nacos.sys.env.AbstractNacosDuplicateBeanPostProcessor
com.alibaba.nacos.sys.env.NacosDuplicateSpringBeanPostProcessor
All Implemented Interfaces:
org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor

public class NacosDuplicateSpringBeanPostProcessor extends AbstractNacosDuplicateBeanPostProcessor
Nacos InstantiationAwareBeanPostProcessor to reduce duplicate rebuild bean for spring beans.

For some important spring beans like spring context beans, if reuse from parent, will cause some problem. So skip.

Author:
xiweng.yy
  • Constructor Summary

    Constructors
    Constructor
    Description
    NacosDuplicateSpringBeanPostProcessor(org.springframework.context.ConfigurableApplicationContext context)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
    isReUsingBean(Class<?> beanClass, String beanName, org.springframework.beans.factory.config.BeanDefinition beanDefinition)
    Judge whether re-use beans from core context.

    Methods inherited from class com.alibaba.nacos.sys.env.AbstractNacosDuplicateBeanPostProcessor

    postProcessBeforeInstantiation

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.beans.factory.config.BeanPostProcessor

    postProcessAfterInitialization, postProcessBeforeInitialization

    Methods inherited from interface org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor

    postProcessAfterInstantiation, postProcessProperties
  • Constructor Details

    • NacosDuplicateSpringBeanPostProcessor

      public NacosDuplicateSpringBeanPostProcessor(org.springframework.context.ConfigurableApplicationContext context)
  • Method Details

    • isReUsingBean

      protected boolean isReUsingBean(Class<?> beanClass, String beanName, org.springframework.beans.factory.config.BeanDefinition beanDefinition)
      Description copied from class: AbstractNacosDuplicateBeanPostProcessor
      Judge whether re-use beans from core context.
      Specified by:
      isReUsingBean in class AbstractNacosDuplicateBeanPostProcessor
      Parameters:
      beanClass - bean class
      beanName - bean name
      beanDefinition - bean definition
      Returns:
      true means re-use beans from core context, otherwise false means to re-build bean in sub context.