public abstract class AsyncExecutionAspectSupport extends Object implements org.springframework.beans.factory.BeanFactoryAware
Provides support for executor qualification on a method-by-method basis.
AsyncExecutionAspectSupport objects must be constructed with a default
Executor, but each individual method may further qualify a specific
bean to be used when executing it, e.g. through an annotation attribute.
|Constructor and Description|
Create a new
|Modifier and Type||Method and Description|
Determine the specific executor to use when executing the given method.
Return the qualifier or bean name of the executor to be used when executing the given async method, typically specified in the form of an annotation attribute.
Supply the executor to be used when executing async methods.
public AsyncExecutionAspectSupport(Executor defaultExecutor)
AsyncExecutionAspectSupport, using the provided default executor unless individual async methods indicate via qualifier that a more specific executor should be used.
defaultExecutor- the executor to use when executing asynchronous methods
public void setExecutor(Executor defaultExecutor)
Executor(typically a Spring
ExecutorService) to delegate to unless a more specific executor has been requested via a qualifier on the async method, in which case the executor will be looked up at invocation time against the enclosing bean factory.
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
BeanFactoryto be used when looking up executors by qualifier.
protected org.springframework.core.task.AsyncTaskExecutor determineAsyncExecutor(Method method)
null, but just if no default executor has been set)
nullindicates that no specific executor has been specified and that the default executor should be used.
method- the method to inspect for executor qualifier metadata