Skip to content

Commit 8d3d07b

Browse files
author
Ryan Baxter
committed
We no longer need InfoEndpointRebinderConfiguration since we will not be supporting Boot 1.3.x in Dalston. See spring-projects#145.
1 parent dde9529 commit 8d3d07b

File tree

1 file changed

+0
-55
lines changed

1 file changed

+0
-55
lines changed

spring-cloud-context/src/main/java/org/springframework/cloud/autoconfigure/RefreshEndpointAutoConfiguration.java

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,6 @@
5858
@AutoConfigureAfter(EndpointAutoConfiguration.class)
5959
public class RefreshEndpointAutoConfiguration {
6060

61-
@ConditionalOnBean(EndpointAutoConfiguration.class)
62-
@ConditionalOnMissingClass("org.springframework.boot.actuate.info.InfoContributor")
63-
@Bean
64-
InfoEndpointRebinderConfiguration infoEndpointRebinderConfiguration() {
65-
return new InfoEndpointRebinderConfiguration();
66-
}
67-
6861
@ConditionalOnMissingBean
6962
@ConditionalOnEnabledHealthIndicator("refresh")
7063
@Bean
@@ -133,52 +126,4 @@ public RefreshEventListener refreshEventListener(
133126
}
134127

135128
}
136-
137-
private static class InfoEndpointRebinderConfiguration
138-
implements ApplicationListener<EnvironmentChangeEvent>, BeanPostProcessor {
139-
140-
@Autowired
141-
private ConfigurableEnvironment environment;
142-
143-
private Map<String, Object> map = new LinkedHashMap<String, Object>();
144-
145-
@Override
146-
public void onApplicationEvent(EnvironmentChangeEvent event) {
147-
for (String key : event.getKeys()) {
148-
if (key.startsWith("info.")) {
149-
this.map.put(key.substring("info.".length()),
150-
this.environment.getProperty(key));
151-
}
152-
}
153-
}
154-
155-
@Override
156-
public Object postProcessAfterInitialization(Object bean, String beanName)
157-
throws BeansException {
158-
if (bean instanceof InfoEndpoint) {
159-
return infoEndpoint((InfoEndpoint) bean);
160-
}
161-
return bean;
162-
}
163-
164-
@Override
165-
public Object postProcessBeforeInitialization(Object bean, String beanName)
166-
throws BeansException {
167-
return bean;
168-
}
169-
170-
private InfoEndpoint infoEndpoint(InfoEndpoint endpoint) {
171-
return new InfoEndpoint(endpoint.invoke()) {
172-
@Override
173-
public Map<String, Object> invoke() {
174-
Map<String, Object> info = new LinkedHashMap<String, Object>(
175-
super.invoke());
176-
info.putAll(InfoEndpointRebinderConfiguration.this.map);
177-
return info;
178-
}
179-
};
180-
}
181-
182-
}
183-
184129
}

0 commit comments

Comments
 (0)