List of usage examples for org.springframework.core.env SystemEnvironmentPropertySource SystemEnvironmentPropertySource
public SystemEnvironmentPropertySource(String name, Map<String, Object> source)
From source file:org.greencheek.utils.environment.propertyplaceholder.spring.ListBasedMutablePropertySources.java
public static PropertySource getSystemEnvironmentProperties() { StandardEnvironment env = new StandardEnvironment(); return new SystemEnvironmentPropertySource(StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, env.getSystemEnvironment()); }
From source file:org.greencheek.utils.environment.propertyplaceholder.spring.EnvironmentalPropertySourcesPlaceholderConfigurerWithSpringValueResolution.java
@Override public void afterPropertiesSet() { if (mergerBuilder == null) { throw new IllegalStateException("The PropertyMergerBuilder must not be null."); }/*from w w w . java 2 s .c om*/ Properties p = mergerBuilder.build().getMergedProperties(); StandardEnvironment env = new StandardEnvironment(); MutablePropertySources sources = new MutablePropertySources(); if (isSystemPropertiesResolutionEnabled()) sources.addLast(new MapPropertySource(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME, env.getSystemProperties())); if (isEnvironmentPropertiesResolutionEnabled()) sources.addLast(new SystemEnvironmentPropertySource( StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, env.getSystemEnvironment())); sources.addFirst(new PropertiesPropertySource(ENVIRONMENT_SPECIFIC_PROPERTIES, p)); super.setPropertySources(sources); }