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

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractNacosDuplicateBeanPostProcessor(org.springframework.context.ConfigurableApplicationContext context)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract boolean
    isReUsingBean(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, 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

    • 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:
      postProcessBeforeInstantiation in interface org.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 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.