Skip to content

Commit

Permalink
set proxyBeanMethods=false on @configuration (#846)
Browse files Browse the repository at this point in the history
Co-authored-by: 致节 <[email protected]>
  • Loading branch information
HzjNeverStop and 致节 authored Jul 27, 2021
1 parent 96a0e9d commit c941f18
Show file tree
Hide file tree
Showing 71 changed files with 88 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* @author qilong.zql
* @since 2.5.0
*/
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties(HealthCheckProperties.class)
@ConditionalOnClass(HealthChecker.class)
public class SofaBootHealthCheckAutoConfiguration {
Expand Down Expand Up @@ -114,7 +114,7 @@ public ComponentHealthChecker sofaComponentHealthChecker(SofaRuntimeContext sofa
return new ComponentHealthChecker(sofaRuntimeContext);
}

@Configuration
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ HealthChecker.class, ModelCreatingStage.class })
@ConditionalOnProperty(value = "com.alipay.sofa.boot.enable-isle", matchIfMissing = true)
public static class SofaModuleHealthIndicatorConfiguration {
Expand All @@ -124,7 +124,7 @@ public ModuleHealthChecker sofaModuleHealthChecker() {
}
}

@Configuration
@Configuration(proxyBeanMethods = false)
@AutoConfigureBefore(HealthEndpointAutoConfiguration.class)
@ConditionalOnClass(HealthChecker.class)
public static class ReadinessCheckExtensionConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @author Zhijie
* @since 2020/7/7
*/
@Configuration
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(StartupReporter.class)
@AutoConfigureBefore(SofaStartupAutoConfiguration.class)
public class StartupEndPointAutoConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* @author huzijie
* @version StartupHealthCheckStageConfiguration.java, v 0.1 2020年12月31日 5:09 下午 huzijie Exp $
*/
@Configuration
@Configuration(proxyBeanMethods = false)
@AutoConfigureBefore(SofaBootHealthCheckAutoConfiguration.class)
@ConditionalOnClass({ HealthChecker.class, StartupReporter.class })
public class StartupHealthCheckStageConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @author qilong.zql
* @since 3.0.0
*/
@Configuration
@Configuration(proxyBeanMethods = false)
public class VersionEndpointAutoConfiguration {
@Bean
@ConditionalOnMissingBean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
* @since 3.2.0
*/
@EnableAutoConfiguration
@Configuration
@Configuration(proxyBeanMethods = false)
public class EmptyConfiguration {
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void testHealthCheckNotReadyLiveness() {
SofaBootConstants.SOFABOOT_HEALTH_CHECK_NOT_READY_MSG));
}

@Configuration
@Configuration(proxyBeanMethods = false)
@EnableAutoConfiguration
static class HealthCheckManagementTestConfiguration {
@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void testCustomConfig() {
}

@EnableAutoConfiguration
@Configuration
@Configuration(proxyBeanMethods = false)
static class EmptyConfiguration {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void startupReporterNotExist() {
}));
}

@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties(value = { HealthEndpointProperties.class })
static class TestHealthCheckConfiguration {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
/**
* @author xuanbei 18/3/12
*/
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties(SofaModuleProperties.class)
@ConditionalOnClass(ApplicationRuntimeModel.class)
@ConditionalOnProperty(value = "com.alipay.sofa.boot.enable-isle", matchIfMissing = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
/**
* @author <a href="mailto:[email protected]">LiWei</a>
*/
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties(SofaBootRpcProperties.class)
@ConditionalOnClass(SofaBootRpcProperties.class)
public class SofaRpcAutoConfiguration {
Expand Down Expand Up @@ -202,7 +202,7 @@ public ApplicationListener boltSwaggerServiceApplicationListener() {
return new BoltSwaggerServiceApplicationListener();
}

@Configuration
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ SofaBootRpcProperties.class, ReadinessCheckCallback.class, Health.class })
public static class RpcAfterHealthCheckCallbackConfiguration {
@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
/**
* @author xuanbei 18/3/17
*/
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties(SofaRuntimeConfigurationProperties.class)
@ConditionalOnClass(SofaFramework.class)
public class SofaRuntimeAutoConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @author Zhijie
* @since 2020/7/8
*/
@Configuration
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(StartupReporter.class)
@EnableConfigurationProperties(StartupProperties.class)
public class SofaStartupAutoConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @author huzijie
* @version SofaStartupIsleAutoConfiguration.java, v 0.1 2021年01月04日 7:07 下午 huzijie Exp $
*/
@Configuration
@Configuration(proxyBeanMethods = false)
@AutoConfigureBefore(SofaModuleAutoConfiguration.class)
@ConditionalOnClass({ ApplicationRuntimeModel.class, StartupReporter.class })
@ConditionalOnProperty(value = "com.alipay.sofa.boot.enable-isle", matchIfMissing = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* @author yangguanchao
* @since 2018/05/01
*/
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties({ OpenTracingSpringMvcProperties.class, SofaTracerProperties.class })
@ConditionalOnProperty(prefix = "com.alipay.sofa.tracer.springmvc", value = "enable", matchIfMissing = true)
@AutoConfigureAfter(SofaTracerAutoConfiguration.class)
Expand All @@ -51,7 +51,7 @@ public class OpenTracingSpringMvcAutoConfiguration {
@Autowired
private OpenTracingSpringMvcProperties openTracingSpringProperties;

@Configuration
@Configuration(proxyBeanMethods = false)
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
@ConditionalOnClass(SpringMvcSofaTracerFilter.class)
public class SpringMvcDelegatingFilterProxyConfiguration {
Expand All @@ -73,7 +73,7 @@ public FilterRegistrationBean springMvcDelegatingFilterProxy() {
}
}

@Configuration
@Configuration(proxyBeanMethods = false)
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)
@ConditionalOnClass(WebfluxSofaTracerFilter.class)
public class WebfluxSofaTracerFilterConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* @author yangguanchao
* @since 2018/05/08
*/
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties(SofaTracerProperties.class)
@ConditionalOnClass({ SpanReportListenerHolder.class, Tracer.class, SofaTracerProperties.class,
FlexibleTracer.class })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @author qilong.zql
* @since 2.2.0
*/
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties(SofaTracerDataSourceProperties.class)
@ConditionalOnProperty(prefix = "com.alipay.sofa.tracer.datasource", value = "enable", matchIfMissing = true)
@ConditionalOnClass({ SmartDataSource.class, SofaTracerDataSourceProperties.class })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/**
* @author guolei.sgl ([email protected]) 2019/3/13 6:04 PM
**/
@Configuration
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ Client.class, SofaTracerFeignContextBeanPostProcessor.class,
SofaTracerFeignContext.class })
@AutoConfigureBefore(FeignAutoConfiguration.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@
/**
* @author guolei.sgl ([email protected]) 2019/9/11 9:43 PM
**/
@Configuration
@Configuration(proxyBeanMethods = false)
@ConditionalOnWebApplication
@ConditionalOnProperty(prefix = "com.alipay.sofa.tracer.resttemplate", value = "enable", matchIfMissing = true)
@ConditionalOnClass({ RestTemplateTracer.class, SofaTracerRestTemplateEnhance.class })
public class SofaTracerRestTemplateAutoConfiguration {

@Bean
public SofaTracerRestTemplateBeanPostProcessor sofaTracerRestTemplateBeanPostProcessor() {
return new SofaTracerRestTemplateBeanPostProcessor(sofaTracerRestTemplateEnhance());
public SofaTracerRestTemplateEnhance sofaTracerRestTemplateEnhance() {
return new SofaTracerRestTemplateEnhance();
}

@Bean
public SofaTracerRestTemplateEnhance sofaTracerRestTemplateEnhance() {
return new SofaTracerRestTemplateEnhance();
public SofaTracerRestTemplateBeanPostProcessor sofaTracerRestTemplateBeanPostProcessor(SofaTracerRestTemplateEnhance sofaTracerRestTemplateEnhance) {
return new SofaTracerRestTemplateBeanPostProcessor(sofaTracerRestTemplateEnhance);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/**
* @author guolei.sgl ([email protected]) 2019/8/9 3:20 PM
**/
@Configuration
@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty(prefix = "com.alipay.sofa.tracer.flexible", value = "enable", matchIfMissing = true)
@AutoConfigureAfter(SofaTracerAutoConfiguration.class)
@ConditionalOnBean(Tracer.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* @author yangguanchao
* @since 2018/05/01
*/
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties(ZipkinSofaTracerProperties.class)
@ConditionalOnProperty(value = "com.alipay.sofa.tracer.zipkin.enabled", matchIfMissing = true)
@ConditionalOnClass({ zipkin2.Span.class, zipkin2.reporter.AsyncReporter.class, RestTemplate.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void testSofaRuntimeManagerHasCtx() {
Assert.assertNotNull(applicationContext.getBean("sofaRuntimeContext"));
}

@Configuration
@Configuration(proxyBeanMethods = false)
@EnableAutoConfiguration
static class SofaRuntimeManagerTestConfiguration {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void testExtensionFailureInsulating() {
Assert.assertTrue(configurationProperties.isExtensionFailureInsulating());
}

@Configuration
@Configuration(proxyBeanMethods = false)
@EnableAutoConfiguration
static class SofaRuntimePropertiesTestConfiguration {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private void initApplicationContext(boolean health, boolean mark, Class clazz) {
ctx = springApplication.run();
}

@Configuration
@Configuration(proxyBeanMethods = false)
static class ReadinessCheckCallbackBreakTestConfiguration extends
AfterHealthReadinessCheckCallbackTestConfiguration {
@Bean
Expand All @@ -146,7 +146,7 @@ public LowestOrderReadinessCheckCallback lowestOrderReadinessCheckCallback() {
}
}

@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties({ HealthCheckProperties.class,
SofaRuntimeConfigurationProperties.class })
static class AfterHealthReadinessCheckCallbackTestConfiguration {
Expand Down Expand Up @@ -181,7 +181,7 @@ public HealthIndicatorProcessor healthIndicatorProcessor() {
}
}

@Configuration
@Configuration(proxyBeanMethods = false)
static class ReadinessCheckFailedTestConfiguration extends
AfterHealthReadinessCheckCallbackTestConfiguration {
@Bean
Expand All @@ -190,7 +190,7 @@ public HealthChecker failedHealthCheck() {
}
}

@Configuration
@Configuration(proxyBeanMethods = false)
static class ReadinessCheckSuccessTestConfiguration extends
AfterHealthReadinessCheckCallbackTestConfiguration {
@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private void initApplicationContext(Map<String, Object> properties, Class config
applicationContext = springApplication.run();
}

@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties({ HealthCheckProperties.class,
SofaRuntimeConfigurationProperties.class })
static class HealthCheckConfigurationTestConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
public class HealthCheckInsulatorTest {
@EnableConfigurationProperties({ HealthCheckProperties.class,
SofaRuntimeConfigurationProperties.class })
@Configuration
@Configuration(proxyBeanMethods = false)
static class HealthCheckConfiguration {
@Bean
public AfterReadinessCheckCallbackProcessor afterReadinessCheckCallbackProcessor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class HealthCheckerProcessorTest {

private ApplicationContext applicationContext;

@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties({ HealthCheckProperties.class,
SofaRuntimeConfigurationProperties.class })
static class HealthCheckerProcessorTestConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class HealthIndicatorCheckProcessorTest {

private ApplicationContext applicationContext;

@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties({ HealthCheckProperties.class,
SofaRuntimeConfigurationProperties.class })
static class HealthIndicatorConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
public class HealthIndicatorExclusionTest {
private ApplicationContext applicationContext;

@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties({ HealthCheckProperties.class,
SofaRuntimeConfigurationProperties.class })
static class HealthIndicatorConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class ManualReadinessCheckListenerSuccessTest {
@Autowired
private ApplicationContext applicationContext;

@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties({ HealthCheckProperties.class,
SofaRuntimeConfigurationProperties.class })
static class HealthCheckConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class ManualReadinessCheckListenerTest {
@Autowired
private ApplicationAvailability applicationAvailability;

@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties({ HealthCheckProperties.class,
SofaRuntimeConfigurationProperties.class })
@Import(ApplicationAvailabilityAutoConfiguration.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ public void testReadinessCheckFailedHttpCode() {
Assert.assertNotNull(healthMap.get("reactiveDemo").getDetails().get("reactiveTest"));
}

@Configuration
@Configuration(proxyBeanMethods = false)
static class ReactiveHealthIndicatorConfiguration {
@Bean
public ReactiveHealthIndicator reactiveDemoHealthIndicator() {
return () -> Mono.just(Health.up().withDetail("reactiveTest", new HashMap<>()).build());
}
}

@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties({ HealthCheckProperties.class,
SofaRuntimeConfigurationProperties.class })
static class ReactiveHealthIndicatorTestConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class ReadinessCheckListenerTest {
@Autowired
private ApplicationAvailability applicationAvailability;

@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties({ HealthCheckProperties.class,
SofaRuntimeConfigurationProperties.class })
@Import(ApplicationAvailabilityAutoConfiguration.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void testVersions404HttpCode() {
Assert.assertEquals(HttpStatus.NOT_FOUND, response.getStatusCode());
}

@Configuration
@Configuration(proxyBeanMethods = false)
static class DownHealthIndicatorConfiguration {
@Bean
public HealthIndicator downHealthIndicator() {
Expand Down
Loading

0 comments on commit c941f18

Please sign in to comment.