Class PropertySourcesLoader

  • All Implemented Interfaces:
    org.springframework.context.ApplicationContextInitializer<org.springframework.context.ConfigurableApplicationContext>

    public class PropertySourcesLoader
    extends Object
    implements org.springframework.context.ApplicationContextInitializer<org.springframework.context.ConfigurableApplicationContext>
    Allows to combine environment properties, default application properties and external application properties. This class can be used in the following ways:
    • In the web.xml, using "contextInitializerClasses" context parameter.
    • In Spring java configuration like new PropertySourcesLoader().initialize(applicationContext)
    Resolving order (next resource overrides previous):
  • OpenL default properties. DefaultPropertySource
  • Java preferences. PreferencePropertySource
  • Application externalized configuration. ApplicationPropertySource
  • Application modifiable configuration. DynamicPropertySource
  • OS environment variables. System.getenv()
  • Java System properties. System.getProperties()
  • JNDI attributes from java:comp/env
  • Servlet context loadProperties parameters from ServletContext.getInitParameter(java.lang.String)
Author:
Yury Molchan
See Also:
PropertySourcesPlaceholderConfigurer, PlaceholderConfigurerSupport, ApplicationContextInitializer, ApplicationPropertySource