{@link Environment} implementation suitable for use in 'standard' (i.e. non-web)applications.
In addition to the usual functions of a {@link ConfigurableEnvironment} such asproperty resolution and profile-related operations, this implementation configures two default property sources, to be searched in the following order:
- {@linkplain AbstractEnvironment#getSystemProperties() system properties}
- {@linkplain AbstractEnvironment#getSystemEnvironment() system environment variables}
That is, if the key "xyz" is present both in the JVM system properties as well as in the set of environment variables for the current process, the value of key "xyz" from system properties will return from a call to {@code environment.getProperty("xyz")}. This ordering is chosen by default because system properties are per-JVM, while environment variables may be the same across many JVMs on a given system. Giving system properties precedence allows for overriding of environment variables on a per-JVM basis.
These default property sources may be removed, reordered, or replaced; and additional property sources may be added using the {@link MutablePropertySources}instance available from {@link #getPropertySources()}. See {@link ConfigurableEnvironment} Javadoc for usage examples.
See {@link SystemEnvironmentPropertySource} Javadoc for details on special handlingof property names in shell environments (e.g. Bash) that disallow period characters in variable names.
@author Chris Beams
@since 3.1
@see ConfigurableEnvironment
@see SystemEnvironmentPropertySource
@see org.springframework.web.context.support.StandardServletEnvironment