Skip to content

Commit a9c3ced

Browse files
committed
Refer to PropertySource names in Spring Boot
Signed-off-by: Yanming Zhou <[email protected]>
1 parent a3ef42f commit a9c3ced

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

spring-cloud-context/src/main/java/org/springframework/cloud/context/refresh/ContextRefresher.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
import org.apache.commons.logging.Log;
2929
import org.apache.commons.logging.LogFactory;
3030

31+
import org.springframework.boot.context.properties.source.ConfigurationPropertySources;
32+
import org.springframework.boot.env.DefaultPropertiesPropertySource;
3133
import org.springframework.cloud.autoconfigure.RefreshAutoConfiguration;
3234
import org.springframework.cloud.context.environment.EnvironmentChangeEvent;
3335
import org.springframework.cloud.context.scope.refresh.RefreshScope;
@@ -51,16 +53,23 @@ public abstract class ContextRefresher {
5153

5254
protected final Log logger = LogFactory.getLog(getClass());
5355

56+
protected static final String REFRESH_ARGS_PROPERTY_SOURCE = "refreshArgs";
57+
58+
/**
59+
* see {@link ConfigurationPropertySources#ATTACHED_PROPERTY_SOURCE_NAME}.
60+
*/
61+
private static final String ATTACHED_PROPERTY_SOURCE_NAME = "configurationProperties";
62+
5463
protected static final String[] DEFAULT_PROPERTY_SOURCES = new String[] {
5564
// order matters, if cli args aren't first, things get messy
56-
CommandLinePropertySource.COMMAND_LINE_PROPERTY_SOURCE_NAME, "defaultProperties" };
65+
CommandLinePropertySource.COMMAND_LINE_PROPERTY_SOURCE_NAME, DefaultPropertiesPropertySource.NAME };
5766

5867
protected Set<String> standardSources = new HashSet<>(
5968
Arrays.asList(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME,
6069
StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME,
6170
StandardServletEnvironment.JNDI_PROPERTY_SOURCE_NAME,
6271
StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME,
63-
StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME, "configurationProperties"));
72+
StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME, ATTACHED_PROPERTY_SOURCE_NAME));
6473

6574
protected final List<String> additionalPropertySourcesToRetain;
6675

0 commit comments

Comments
 (0)