Skip to content

Commit

Permalink
Fix boot 1 configuration to not require AOP
Browse files Browse the repository at this point in the history
  • Loading branch information
jkschneider committed Jun 17, 2017
1 parent 4b09ec1 commit cc8c23d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* @author Jon Schneider
*/
@Configuration
// this class didn't exist until Spring 5
@ConditionalOnMissingClass("org.springframework.web.server.WebFilter") // TODO got to be a better way...
@Import({
InstrumentRestTemplateConfiguration.class,
Expand All @@ -53,7 +54,7 @@ static class WebMvcConfiguration {}
* If AOP is not enabled, scheduled interception will not work.
*/
@Bean
@ConditionalOnClass({RestTemplate.class, JoinPoint.class})
@ConditionalOnClass(name = {"org.springframework.web.client.RestTemplate", "org.aopalliance.intercept.JoinPoint"})
@ConditionalOnProperty(value = "spring.aop.enabled", havingValue = "true", matchIfMissing = true)
public MetricsSchedulingAspect metricsSchedulingAspect(MeterRegistry registry) {
return new MetricsSchedulingAspect(registry);
Expand All @@ -64,7 +65,7 @@ public MetricsSchedulingAspect metricsSchedulingAspect(MeterRegistry registry) {
* will always be evaluated to "none".
*/
@Configuration
@ConditionalOnClass({RestTemplate.class, JoinPoint.class})
@ConditionalOnClass(name = {"org.springframework.web.client.RestTemplate", "org.aopalliance.intercept.JoinPoint"})
@ConditionalOnProperty(value = "spring.aop.enabled", havingValue = "true", matchIfMissing = true)
static class MetricsRestTemplateAspectConfiguration {
@Bean
Expand Down

0 comments on commit cc8c23d

Please sign in to comment.