@Target(value={TYPE,METHOD}) @Retention(value=RUNTIME) @Documented public @interface Async
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: e.g.
Spring's AsyncResult
or EJB 3.1's javax.ejb.AsyncResult
.
AsyncExecutionInterceptor
,
AsyncAnnotationAdvisor
Copyright © 2015. All Rights Reserved.