Rename MvcAsyncTask to WebAsyncTask
The name MvcAsyncTask is misleading because the class is part of Spring Web as apposed to Spring MVC. This is also inconsistent with the other async classes which use Web instead of Mvc. This commit changes MvcAsyncTask to WebAsyncTask making it more consistent with the jar it is found in and the other async classes. Issue: SPR-10051
This commit is contained in:
committed by
Rossen Stoyanchev
parent
ce7fa8a98e
commit
157a1d6ee2
@@ -23,7 +23,7 @@ import java.util.concurrent.Callable;
|
||||
import org.springframework.core.task.AsyncTaskExecutor;
|
||||
import org.springframework.core.task.SimpleAsyncTaskExecutor;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.context.request.async.MvcAsyncTask;
|
||||
import org.springframework.web.context.request.async.WebAsyncTask;
|
||||
import org.springframework.web.context.request.async.CallableProcessingInterceptor;
|
||||
import org.springframework.web.context.request.async.DeferredResult;
|
||||
import org.springframework.web.context.request.async.DeferredResultProcessingInterceptor;
|
||||
@@ -50,7 +50,7 @@ public class AsyncSupportConfigurer {
|
||||
/**
|
||||
* Set the default {@link AsyncTaskExecutor} to use when a controller method
|
||||
* returns a {@link Callable}. Controller methods can override this default on
|
||||
* a per-request basis by returning an {@link MvcAsyncTask}.
|
||||
* a per-request basis by returning an {@link WebAsyncTask}.
|
||||
*
|
||||
* <p>By default a {@link SimpleAsyncTaskExecutor} instance is used and it's
|
||||
* highly recommended to change that default in production since the simple
|
||||
|
||||
@@ -19,13 +19,13 @@ package org.springframework.web.servlet.mvc.method.annotation;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.web.context.request.NativeWebRequest;
|
||||
import org.springframework.web.context.request.async.MvcAsyncTask;
|
||||
import org.springframework.web.context.request.async.WebAsyncTask;
|
||||
import org.springframework.web.context.request.async.WebAsyncUtils;
|
||||
import org.springframework.web.method.support.HandlerMethodReturnValueHandler;
|
||||
import org.springframework.web.method.support.ModelAndViewContainer;
|
||||
|
||||
/**
|
||||
* Handles return values of type {@link MvcAsyncTask}.
|
||||
* Handles return values of type {@link WebAsyncTask}.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 3.2
|
||||
@@ -41,7 +41,7 @@ public class AsyncTaskMethodReturnValueHandler implements HandlerMethodReturnVal
|
||||
|
||||
public boolean supportsReturnType(MethodParameter returnType) {
|
||||
Class<?> paramType = returnType.getParameterType();
|
||||
return MvcAsyncTask.class.isAssignableFrom(paramType);
|
||||
return WebAsyncTask.class.isAssignableFrom(paramType);
|
||||
}
|
||||
|
||||
public void handleReturnValue(Object returnValue,
|
||||
@@ -53,9 +53,9 @@ public class AsyncTaskMethodReturnValueHandler implements HandlerMethodReturnVal
|
||||
return;
|
||||
}
|
||||
|
||||
MvcAsyncTask<?> mvcAsyncTask = (MvcAsyncTask<?>) returnValue;
|
||||
mvcAsyncTask.setBeanFactory(this.beanFactory);
|
||||
WebAsyncUtils.getAsyncManager(webRequest).startCallableProcessing(mvcAsyncTask, mavContainer);
|
||||
WebAsyncTask<?> webAsyncTask = (WebAsyncTask<?>) returnValue;
|
||||
webAsyncTask.setBeanFactory(this.beanFactory);
|
||||
WebAsyncUtils.getAsyncManager(webRequest).startCallableProcessing(webAsyncTask, mavContainer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ import org.springframework.web.bind.support.WebDataBinderFactory;
|
||||
import org.springframework.web.context.request.NativeWebRequest;
|
||||
import org.springframework.web.context.request.ServletWebRequest;
|
||||
import org.springframework.web.context.request.WebRequest;
|
||||
import org.springframework.web.context.request.async.MvcAsyncTask;
|
||||
import org.springframework.web.context.request.async.WebAsyncTask;
|
||||
import org.springframework.web.context.request.async.AsyncWebRequest;
|
||||
import org.springframework.web.context.request.async.CallableProcessingInterceptor;
|
||||
import org.springframework.web.context.request.async.DeferredResultProcessingInterceptor;
|
||||
@@ -348,7 +348,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter i
|
||||
/**
|
||||
* Set the default {@link AsyncTaskExecutor} to use when a controller method
|
||||
* return a {@link Callable}. Controller methods can override this default on
|
||||
* a per-request basis by returning an {@link MvcAsyncTask}.
|
||||
* a per-request basis by returning an {@link WebAsyncTask}.
|
||||
* <p>By default a {@link SimpleAsyncTaskExecutor} instance is used.
|
||||
* It's recommended to change that default in production as the simple executor
|
||||
* does not re-use threads.
|
||||
|
||||
Reference in New Issue
Block a user