Class ModifyPopulatorListBeanPostProcessor

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.config.BeanPostProcessor

    public class ModifyPopulatorListBeanPostProcessor
    extends java.lang.Object
    implements org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.beans.factory.BeanFactoryAware
    This is BeanPostProcessor for adding populators into existing populatorList or any parent in spring declaration.

    It process all instances of ModifyPopulatorList beans and applies modification stored in those beans to given objects. If for some reasons (lazyInit) ModifyPopulatorList is not instanciated then this post processor will not get triggered which may lead to some nasty bugs.

    Forcing this BeanPostProcessor to load all ModifyPopulatorList instances during its initialization (via dependency injection or by extracting them form ApplicationContext) will lead to change in order in which beans are intialized. Especially some beans will be instanciated before other BeanPostProcessors which may highly affect stability of the system, so its a bad idea.

    • Constructor Detail

      • ModifyPopulatorListBeanPostProcessor

        public ModifyPopulatorListBeanPostProcessor()
    • Method Detail

      • setBeanFactory

        public void setBeanFactory​(org.springframework.beans.factory.BeanFactory beanFactory)
                            throws org.springframework.beans.BeansException
        Specified by:
        setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
        Throws:
        org.springframework.beans.BeansException
      • initialize

        @PostConstruct
        public void initialize()
      • postProcessBeforeInitialization

        public java.lang.Object postProcessBeforeInitialization​(java.lang.Object bean,
                                                                java.lang.String beanName)
                                                         throws org.springframework.beans.BeansException
        Specified by:
        postProcessBeforeInitialization in interface org.springframework.beans.factory.config.BeanPostProcessor
        Throws:
        org.springframework.beans.BeansException
      • postProcessAfterInitialization

        public java.lang.Object postProcessAfterInitialization​(java.lang.Object bean,
                                                               java.lang.String beanName)
                                                        throws org.springframework.beans.BeansException
        Specified by:
        postProcessAfterInitialization in interface org.springframework.beans.factory.config.BeanPostProcessor
        Throws:
        org.springframework.beans.BeansException