Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

init without non-type bean #465

Merged
merged 2 commits into from
Jan 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,6 @@ public class HealthAutoConfiguration implements ApplicationContextAware {

private ApplicationContext context;

@Bean
public void initEndpoint() {
WebEndpointProperties webEndpointProperties = this.context
.getBean(WebEndpointProperties.class);
WebEndpointProperties.Exposure exposure = webEndpointProperties.getExposure();
Set<String> includePath = exposure.getInclude();
includePath.add("*");
webEndpointProperties.getExposure().setInclude(includePath);
webEndpointProperties.setBasePath("/");
}

@Bean
@ConditionalOnAvailableEndpoint
public ArkHealthEndpoint arkHealthEndpoint() {
Expand All @@ -76,6 +65,13 @@ public MasterBizHealthIndicator masterBizHealthIndicator() {

@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
WebEndpointProperties webEndpointProperties = applicationContext.getBean(WebEndpointProperties.class);
WebEndpointProperties.Exposure exposure = webEndpointProperties.getExposure();
Set<String> includePath = exposure.getInclude();
includePath.add("*");
webEndpointProperties.getExposure().setInclude(includePath);
webEndpointProperties.setBasePath("/");

this.context = applicationContext;
}
}
Loading