Class SystemPropertyOverrideConfigurer

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

    public class SystemPropertyOverrideConfigurer
    extends org.springframework.core.io.support.PropertiesLoaderSupport
    implements org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.PriorityOrdered
    A Spring BeanFactoryPostProcessor that can be used to override System properties (see System.getProperties()) from within a Spring application context. Because it is a BeanFactoryPostProcessor and also implements PriorityOrdered, this processor can be configured to run before almost anything else when constructing a Spring application context, especially if you set the order property to something low. This is useful for setting System properties before another BeanFactoryPostProcessor like PropertyPlaceholderConfigurer or PropertyOverrideConfigurer are applied.
    Author:
    bdferris
    See Also:
    BeanFactoryPostProcessor, PropertiesLoaderSupport, PropertyOverrideConfigurer, PropertyPlaceholderConfigurer
    • Field Summary

      • Fields inherited from class org.springframework.core.io.support.PropertiesLoaderSupport

        localOverride, localProperties, logger
      • Fields inherited from interface org.springframework.core.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Constructor Detail

      • SystemPropertyOverrideConfigurer

        public SystemPropertyOverrideConfigurer()
    • Method Detail

      • setOrder

        public void setOrder​(int order)
      • getOrder

        public int getOrder()
        Specified by:
        getOrder in interface org.springframework.core.Ordered
      • 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