Browse Source

Polishing

pull/493/head
Juergen Hoeller 11 years ago
parent
commit
7230d6a1aa
  1. 1
      spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java
  2. 10
      spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionInterceptor.java

1
spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java

@ -21,7 +21,6 @@ import java.util.Map; @@ -21,7 +21,6 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.annotation.BeanFactoryAnnotationUtils;

10
spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionInterceptor.java

@ -76,7 +76,7 @@ public class AsyncExecutionInterceptor extends AsyncExecutionAspectSupport @@ -76,7 +76,7 @@ public class AsyncExecutionInterceptor extends AsyncExecutionAspectSupport
/**
* Create a new {@code AsyncExecutionInterceptor}.
* @param defaultExecutor the {@link Executor} (typically a Spring {@link AsyncTaskExecutor}
* or {@link java.util.concurrent.ExecutorService}) to delegate to.
* or {@link java.util.concurrent.ExecutorService}) to delegate to
* @param exceptionHandler the {@link AsyncUncaughtExceptionHandler} to use
*/
public AsyncExecutionInterceptor(Executor defaultExecutor, AsyncUncaughtExceptionHandler exceptionHandler) {
@ -111,10 +111,10 @@ public class AsyncExecutionInterceptor extends AsyncExecutionAspectSupport @@ -111,10 +111,10 @@ public class AsyncExecutionInterceptor extends AsyncExecutionAspectSupport
@Override
public Object invoke(final MethodInvocation invocation) throws Throwable {
Class<?> targetClass = (invocation.getThis() != null ? AopUtils.getTargetClass(invocation.getThis()) : null);
Method tmp = ClassUtils.getMostSpecificMethod(invocation.getMethod(), targetClass);
final Method specificMethod = BridgeMethodResolver.findBridgedMethod(tmp);
Method specificMethod = ClassUtils.getMostSpecificMethod(invocation.getMethod(), targetClass);
final Method userDeclaredMethod = BridgeMethodResolver.findBridgedMethod(specificMethod);
AsyncTaskExecutor executor = determineAsyncExecutor(specificMethod);
AsyncTaskExecutor executor = determineAsyncExecutor(userDeclaredMethod);
if (executor == null) {
throw new IllegalStateException(
"No executor specified and no default executor set on AsyncExecutionInterceptor either");
@ -131,7 +131,7 @@ public class AsyncExecutionInterceptor extends AsyncExecutionAspectSupport @@ -131,7 +131,7 @@ public class AsyncExecutionInterceptor extends AsyncExecutionAspectSupport
}
}
catch (Throwable ex) {
handleError(ex, specificMethod, invocation.getArguments());
handleError(ex, userDeclaredMethod, invocation.getArguments());
}
return null;
}

Loading…
Cancel
Save