Class LazyInitByDefaultPostProcessor

  • All Implemented Interfaces:
    org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.Ordered

    public class LazyInitByDefaultPostProcessor
    extends Object
    implements org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.Ordered
    Mark beans as lazy-init by default.

    Beans annotated with Lazy or annotated with the ubic.gemma.core.context.LazyInitByDefaultPostProcessor.ignore attribute are excluded.

    Beans part of the infrastructure role are excluded.

    This is a necessary workaround because Spring 3 does not support lazy-by-default for annotated components.

    Spring Boot provides a similar functionality with LazyInitializationBeanFactoryPostProcessor.

    Author:
    poirigui
    • Constructor Detail

      • LazyInitByDefaultPostProcessor

        public LazyInitByDefaultPostProcessor()
    • Method Detail

      • postProcessBeanFactory

        public void postProcessBeanFactory​(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
                                    throws org.springframework.beans.BeansException
        Specified by:
        postProcessBeanFactory in interface org.springframework.beans.factory.config.BeanFactoryPostProcessor
        Throws:
        org.springframework.beans.BeansException
      • getOrder

        public int getOrder()
        Specified by:
        getOrder in interface org.springframework.core.Ordered