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

Commit c14e696

Browse files
authored
init without non-type bean
1 parent bd5a950 commit c14e696

File tree

1 file changed

+7
-11
lines changed
  • sofa-serverless-runtime/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/health

1 file changed

+7
-11
lines changed

sofa-serverless-runtime/arklet-springboot-starter/src/main/java/com/alipay/sofa/serverless/arklet/springboot/starter/health/HealthAutoConfiguration.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,6 @@ public class HealthAutoConfiguration implements ApplicationContextAware {
4141

4242
private ApplicationContext context;
4343

44-
@Bean
45-
public void initEndpoint() {
46-
WebEndpointProperties webEndpointProperties = this.context
47-
.getBean(WebEndpointProperties.class);
48-
WebEndpointProperties.Exposure exposure = webEndpointProperties.getExposure();
49-
Set<String> includePath = exposure.getInclude();
50-
includePath.add("*");
51-
webEndpointProperties.getExposure().setInclude(includePath);
52-
webEndpointProperties.setBasePath("/");
53-
}
54-
5544
@Bean
5645
@ConditionalOnAvailableEndpoint
5746
public ArkHealthEndpoint arkHealthEndpoint() {
@@ -76,6 +65,13 @@ public MasterBizHealthIndicator masterBizHealthIndicator() {
7665

7766
@Override
7867
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
68+
WebEndpointProperties webEndpointProperties = applicationContext.getBean(WebEndpointProperties.class);
69+
WebEndpointProperties.Exposure exposure = webEndpointProperties.getExposure();
70+
Set<String> includePath = exposure.getInclude();
71+
includePath.add("*");
72+
webEndpointProperties.getExposure().setInclude(includePath);
73+
webEndpointProperties.setBasePath("/");
74+
7975
this.context = applicationContext;
8076
}
8177
}

0 commit comments

Comments
 (0)