Skip to content

Commit 3f48fb8

Browse files
authored
Improve performance by add enumerable propertySource
Update `ManagementContextAutoConfiguration`. use an EnumerablePropertySource to provide better property binding performance Signed-off-by: tanruian <tanruiantra@qq.com>
1 parent 740b00e commit 3f48fb8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementContextAutoConfiguration.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,14 @@ private void verifyAddressConfiguration() {
8484
* @param environment the environment
8585
*/
8686
private void addLocalManagementPortPropertyAlias(ConfigurableEnvironment environment) {
87-
environment.getPropertySources().addLast(new PropertySource<>("Management Server") {
87+
environment.getPropertySources().addLast(new EnumerablePropertySource<>("Management Server") {
88+
89+
public static final String[] PROPERTIES = { "local.management.port" };
90+
91+
@Override
92+
public String[] getPropertyNames() {
93+
return PROPERTIES;
94+
}
8895

8996
@Override
9097
public Object getProperty(String name) {

0 commit comments

Comments
 (0)