Explicit javadoc references to BeanFactory-based default executor lookup
Issue: SPR-14030
This commit is contained in:
parent
155fa3754b
commit
f2f87ff1e0
|
|
@ -119,6 +119,7 @@ public abstract class AsyncExecutionAspectSupport implements BeanFactoryAware {
|
|||
* executor will be looked up at invocation time against the enclosing bean factory
|
||||
* @see #getExecutorQualifier(Method)
|
||||
* @see #setBeanFactory(BeanFactory)
|
||||
* @see #getDefaultExecutor(BeanFactory)
|
||||
*/
|
||||
public void setExecutor(Executor defaultExecutor) {
|
||||
this.defaultExecutor = defaultExecutor;
|
||||
|
|
@ -133,7 +134,10 @@ public abstract class AsyncExecutionAspectSupport implements BeanFactoryAware {
|
|||
}
|
||||
|
||||
/**
|
||||
* Set the {@link BeanFactory} to be used when looking up executors by qualifier.
|
||||
* Set the {@link BeanFactory} to be used when looking up executors by qualifier
|
||||
* or when relying on the default executor lookup algorithm.
|
||||
* @see #findQualifiedExecutor(BeanFactory, String)
|
||||
* @see #getDefaultExecutor(BeanFactory)
|
||||
*/
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
package org.springframework.scheduling.aspectj;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import org.aspectj.lang.annotation.SuppressAjWarnings;
|
||||
|
|
@ -29,27 +28,32 @@ import org.springframework.core.task.AsyncTaskExecutor;
|
|||
/**
|
||||
* Abstract aspect that routes selected methods asynchronously.
|
||||
*
|
||||
* <p>This aspect needs to be injected with an implementation of
|
||||
* {@link Executor} to activate it for a specific thread pool.
|
||||
* Otherwise it will simply delegate all calls synchronously.
|
||||
* <p>This aspect needs to be injected with an implementation of a task-oriented
|
||||
* {@link java.util.concurrent.Executor} to activate it for a specific thread pool,
|
||||
* 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 Juergen Hoeller
|
||||
* @author Chris Beams
|
||||
* @author Stephane Nicoll
|
||||
* @since 3.0.5
|
||||
* @see #setExecutor
|
||||
* @see #setBeanFactory
|
||||
* @see #getDefaultExecutor
|
||||
*/
|
||||
public abstract aspect AbstractAsyncExecutionAspect extends AsyncExecutionAspectSupport {
|
||||
|
||||
/**
|
||||
* Create an {@code AnnotationAsyncExecutionAspect} with a {@code null} default
|
||||
* executor, which should instead be set via {@code #aspectOf} and
|
||||
* {@link #setExecutor(Executor)}. The same applies for {@link #setExceptionHandler}
|
||||
* Create an {@code AnnotationAsyncExecutionAspect} with a {@code null}
|
||||
* default executor, which should instead be set via {@code #aspectOf} and
|
||||
* {@link #setExecutor}. The same applies for {@link #setExceptionHandler}.
|
||||
*/
|
||||
public AbstractAsyncExecutionAspect() {
|
||||
super(null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Apply around advice to methods matching the {@link #asyncMethod()} pointcut,
|
||||
* submit the actual calling of the method to the correct task executor and return
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -33,9 +33,17 @@ import org.springframework.scheduling.annotation.Async;
|
|||
* on the return type. If, however, a class marked with {@code @Async} contains a method
|
||||
* that violates this constraint, it produces only a warning.
|
||||
*
|
||||
* <p>This aspect needs to be injected with an implementation of a task-oriented
|
||||
* {@link java.util.concurrent.Executor} to activate it for a specific thread pool,
|
||||
* 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 Chris Beams
|
||||
* @since 3.0.5
|
||||
* @see #setExecutor
|
||||
* @see #setBeanFactory
|
||||
* @see #getDefaultExecutor
|
||||
*/
|
||||
public aspect AnnotationAsyncExecutionAspect extends AbstractAsyncExecutionAspect {
|
||||
|
||||
|
|
@ -74,7 +82,6 @@ public aspect AnnotationAsyncExecutionAspect extends AbstractAsyncExecutionAspec
|
|||
|
||||
declare warning:
|
||||
execution(!(void || Future+) (@Async *).*(..)):
|
||||
"Methods in a class marked with @Async that do not return void or Future will " +
|
||||
"be routed synchronously";
|
||||
"Methods in a class marked with @Async that do not return void or Future will be routed synchronously";
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue