|
spring-context | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.aop.support.AbstractPointcutAdvisor
org.springframework.scheduling.annotation.AsyncAnnotationAdvisor
public class AsyncAnnotationAdvisor
Advisor that activates asynchronous method execution through the Async
annotation. This annotation can be used at the method and type level in
implementation classes as well as in service interfaces.
This advisor detects the EJB 3.1 javax.ejb.Asynchronous
annotation as well, treating it exactly like Spring's own Async.
Furthermore, a custom async annotation type may get specified through the
"asyncAnnotationType" property.
org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor,
Repository,
org.springframework.dao.DataAccessException,
org.springframework.dao.support.PersistenceExceptionTranslator,
Serialized Form| Field Summary |
|---|
| Fields inherited from interface org.springframework.core.Ordered |
|---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
| Constructor Summary | |
|---|---|
AsyncAnnotationAdvisor()
Create a new AsyncAnnotationAdvisor for bean-style configuration. |
|
AsyncAnnotationAdvisor(java.util.concurrent.Executor executor)
Create a new AsyncAnnotationAdvisor for the given task executor. |
|
| Method Summary | |
|---|---|
protected org.aopalliance.aop.Advice |
buildAdvice(java.util.concurrent.Executor executor)
|
protected org.springframework.aop.Pointcut |
buildPointcut(java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> asyncAnnotationTypes)
Calculate a pointcut for the given async annotation types, if any. |
void |
delegateBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
|
org.aopalliance.aop.Advice |
getAdvice()
|
org.springframework.aop.Pointcut |
getPointcut()
|
void |
setAsyncAnnotationType(java.lang.Class<? extends java.lang.annotation.Annotation> asyncAnnotationType)
Set the 'async' annotation type. |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
Set the BeanFactory to be used when looking up executors by qualifier. |
void |
setTaskExecutor(java.util.concurrent.Executor executor)
Specify the task executor to use for asynchronous methods. |
| Methods inherited from class org.springframework.aop.support.AbstractPointcutAdvisor |
|---|
equals, getOrder, hashCode, isPerInstance, setOrder |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AsyncAnnotationAdvisor()
AsyncAnnotationAdvisor for bean-style configuration.
public AsyncAnnotationAdvisor(java.util.concurrent.Executor executor)
AsyncAnnotationAdvisor for the given task executor.
executor - the task executor to use for asynchronous methods| Method Detail |
|---|
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
throws org.springframework.beans.BeansException
BeanFactory to be used when looking up executors by qualifier.
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwareorg.springframework.beans.BeansExceptionpublic void delegateBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
public void setTaskExecutor(java.util.concurrent.Executor executor)
public void setAsyncAnnotationType(java.lang.Class<? extends java.lang.annotation.Annotation> asyncAnnotationType)
The default async annotation type is the Async annotation, as well
as the EJB 3.1 javax.ejb.Asynchronous annotation (if present).
This setter property exists so that developers can provide their own (non-Spring-specific) annotation type to indicate that a method is to be executed asynchronously.
asyncAnnotationType - the desired annotation typepublic org.aopalliance.aop.Advice getAdvice()
getAdvice in interface org.springframework.aop.Advisorpublic org.springframework.aop.Pointcut getPointcut()
getPointcut in interface org.springframework.aop.PointcutAdvisorprotected org.aopalliance.aop.Advice buildAdvice(java.util.concurrent.Executor executor)
protected org.springframework.aop.Pointcut buildPointcut(java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> asyncAnnotationTypes)
asyncAnnotationTypes - the async annotation types to introspect
null if none
|
spring-context | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||