|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Target(value={METHOD,TYPE}) @Retention(value=RUNTIME) @Documented public @interface Async
Annotation that marks a method as a candidate for asynchronous execution. Can also be used at the type level, in which case all of the type's methods are considered as asynchronous.
In terms of target method signatures, any parameter types are supported.
However, the return type is constrained to either void
or
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 AsyncResult
.
AnnotationAsyncExecutionInterceptor
,
AsyncAnnotationAdvisor
Optional Element Summary | |
---|---|
String |
value
A qualifier value for the specified asynchronous operation(s). |
public abstract String value
May be used to determine the target executor to be used when executing this
method, matching the qualifier value (or the bean name) of a specific
Executor
or
TaskExecutor
bean definition.
When specified on a class level @Async
annotation, indicates that the
given executor should be used for all methods within the class. Method level use
of value()
always overrides any value set at the class level.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |