MethodInterceptor
that processes method invocations asynchronously, using a given {@link org.springframework.core.task.AsyncTaskExecutor}. Typically used with the {@link org.springframework.scheduling.annotation.Async} annotation.In terms of target method signatures, any parameter types are supported. However, the return type is constrained to either void
or java.util.concurrent.Future
. In the latter case, the Future handle returned from the proxy will be an actual asynchronous Future that can be used to track the result of the asynchronous method execution. However, since the target method needs to implement the same signature, it will have to return a temporary Future handle that just passes the return value through (like Spring's {@link org.springframework.scheduling.annotation.AsyncResult}or EJB 3.1's javax.ejb.AsyncResult
).
As of Spring 3.1.2 the {@code AnnotationAsyncExecutionInterceptor} subclass ispreferred for use due to its support for executor qualification in conjunction with Spring's {@code @Async} annotation. @author Juergen Hoeller @author Chris Beams @since 3.0 @see org.springframework.scheduling.annotation.Async @see org.springframework.scheduling.annotation.AsyncAnnotationAdvisor @see org.springframework.scheduling.annotation.AnnotationAsyncExecutionInterceptor
|
|