Fix pointcut for async controllers

We need @within (not @target) to capture method executions inside
annotated controllers. With @target all beans with methods returning
Callable get wrapped in case at runtime there is a target match.
This commit is contained in:
Dave Syer
2015-08-20 12:12:05 +01:00
parent 23868f35b7
commit 3188a01fa1
2 changed files with 3 additions and 3 deletions

View File

@@ -17,8 +17,8 @@
package org.springframework.cloud.sleuth;
import lombok.extern.apachecommons.CommonsLog;
import org.springframework.core.NamedThreadLocal;
import org.springframework.util.Assert;
/**
* @author Spencer Gibb

View File

@@ -64,11 +64,11 @@ public class TraceWebAspect {
this.trace = trace;
}
@Pointcut("@target(org.springframework.web.bind.annotation.RestController)")
@Pointcut("@within(org.springframework.web.bind.annotation.RestController)")
private void anyRestControllerAnnotated() {
}
@Pointcut("@target(org.springframework.stereotype.Controller)")
@Pointcut("@within(org.springframework.stereotype.Controller)")
private void anyControllerAnnotated() {
}