|
|
|
@ -17,7 +17,6 @@ |
|
|
|
package org.springframework.scheduling.aspectj; |
|
|
|
package org.springframework.scheduling.aspectj; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.concurrent.Callable; |
|
|
|
import java.util.concurrent.Callable; |
|
|
|
import java.util.concurrent.Executor; |
|
|
|
|
|
|
|
import java.util.concurrent.Future; |
|
|
|
import java.util.concurrent.Future; |
|
|
|
|
|
|
|
|
|
|
|
import org.aspectj.lang.annotation.SuppressAjWarnings; |
|
|
|
import org.aspectj.lang.annotation.SuppressAjWarnings; |
|
|
|
@ -29,27 +28,32 @@ import org.springframework.core.task.AsyncTaskExecutor; |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Abstract aspect that routes selected methods asynchronously. |
|
|
|
* Abstract aspect that routes selected methods asynchronously. |
|
|
|
* |
|
|
|
* |
|
|
|
* <p>This aspect needs to be injected with an implementation of |
|
|
|
* <p>This aspect needs to be injected with an implementation of a task-oriented |
|
|
|
* {@link Executor} to activate it for a specific thread pool. |
|
|
|
* {@link java.util.concurrent.Executor} to activate it for a specific thread pool, |
|
|
|
* Otherwise it will simply delegate all calls synchronously. |
|
|
|
* or with a {@link org.springframework.beans.factory.BeanFactory} for default |
|
|
|
|
|
|
|
* executor lookup. Otherwise it will simply delegate all calls synchronously. |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Ramnivas Laddad |
|
|
|
* @author Ramnivas Laddad |
|
|
|
* @author Juergen Hoeller |
|
|
|
* @author Juergen Hoeller |
|
|
|
* @author Chris Beams |
|
|
|
* @author Chris Beams |
|
|
|
* @author Stephane Nicoll |
|
|
|
* @author Stephane Nicoll |
|
|
|
* @since 3.0.5 |
|
|
|
* @since 3.0.5 |
|
|
|
|
|
|
|
* @see #setExecutor |
|
|
|
|
|
|
|
* @see #setBeanFactory |
|
|
|
|
|
|
|
* @see #getDefaultExecutor |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract aspect AbstractAsyncExecutionAspect extends AsyncExecutionAspectSupport { |
|
|
|
public abstract aspect AbstractAsyncExecutionAspect extends AsyncExecutionAspectSupport { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Create an {@code AnnotationAsyncExecutionAspect} with a {@code null} default |
|
|
|
* Create an {@code AnnotationAsyncExecutionAspect} with a {@code null} |
|
|
|
* executor, which should instead be set via {@code #aspectOf} and |
|
|
|
* default executor, which should instead be set via {@code #aspectOf} and |
|
|
|
* {@link #setExecutor(Executor)}. The same applies for {@link #setExceptionHandler} |
|
|
|
* {@link #setExecutor}. The same applies for {@link #setExceptionHandler}. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public AbstractAsyncExecutionAspect() { |
|
|
|
public AbstractAsyncExecutionAspect() { |
|
|
|
super(null); |
|
|
|
super(null); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Apply around advice to methods matching the {@link #asyncMethod()} pointcut, |
|
|
|
* Apply around advice to methods matching the {@link #asyncMethod()} pointcut, |
|
|
|
* submit the actual calling of the method to the correct task executor and return |
|
|
|
* submit the actual calling of the method to the correct task executor and return |
|
|
|
|