类 WebAsyncTask<V>
- 类型参数:
V- the value type
- 所有已实现的接口:
cn.taketoday.beans.factory.Aware,cn.taketoday.beans.factory.BeanFactoryAware
Callable, a timeout value, and a task executor.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev, Juergen Hoeller
-
字段概要
字段 -
构造器概要
构造器构造器说明WebAsyncTask(Long timeout, cn.taketoday.core.task.AsyncTaskExecutor executor, Callable<V> callable) Create aWebAsyncTaskwith a timeout value, an executor instance, and a Callable.WebAsyncTask(Long timeout, String executorName, Callable<V> callable) Create aWebAsyncTaskwith a timeout value, an executor name, and aCallable.WebAsyncTask(Long timeout, Callable<V> callable) Create aWebAsyncTaskwith a timeout value and aCallable.WebAsyncTask(Callable<V> callable) Create aWebAsyncTaskwrapping the givenCallable. -
方法概要
修饰符和类型方法说明Callable<?>Return theCallableto use for concurrent handling (nevernull).cn.taketoday.core.task.AsyncTaskExecutorReturn the AsyncTaskExecutor to use for concurrent handling, ornullif none specified.(专用程序包) CallableProcessingInterceptorReturn the timeout value in milliseconds, ornullif no timeout is set.voidonCompletion(Runnable callback) Register code to invoke when the async request completes.voidRegister code to invoke for an error during async request processing.voidRegister code to invoke when the async request times out.voidsetBeanFactory(cn.taketoday.beans.factory.BeanFactory beanFactory) ABeanFactoryto use for resolving an executor name.
-
字段详细资料
-
callable
-
timeout
-
executor
private cn.taketoday.core.task.AsyncTaskExecutor executor -
executorName
-
beanFactory
private cn.taketoday.beans.factory.BeanFactory beanFactory -
timeoutCallback
-
errorCallback
-
completionCallback
-
-
构造器详细资料
-
WebAsyncTask
Create aWebAsyncTaskwrapping the givenCallable.- 参数:
callable- the callable for concurrent handling
-
WebAsyncTask
Create aWebAsyncTaskwith a timeout value and aCallable.- 参数:
timeout- a timeout value in millisecondscallable- the callable for concurrent handling
-
WebAsyncTask
Create aWebAsyncTaskwith a timeout value, an executor name, and aCallable.- 参数:
timeout- the timeout value in milliseconds; ignored ifnullexecutorName- the name of an executor bean to usecallable- the callable for concurrent handling
-
WebAsyncTask
public WebAsyncTask(@Nullable Long timeout, cn.taketoday.core.task.AsyncTaskExecutor executor, Callable<V> callable) Create aWebAsyncTaskwith a timeout value, an executor instance, and a Callable.- 参数:
timeout- the timeout value in milliseconds; ignored ifnullexecutor- the executor to usecallable- the callable for concurrent handling
-
-
方法详细资料
-
getCallable
Return theCallableto use for concurrent handling (nevernull). -
getTimeout
Return the timeout value in milliseconds, ornullif no timeout is set. -
setBeanFactory
public void setBeanFactory(cn.taketoday.beans.factory.BeanFactory beanFactory) ABeanFactoryto use for resolving an executor name.This factory reference will automatically be set when
WebAsyncTaskis used within a Web MVC controller.- 指定者:
setBeanFactory在接口中cn.taketoday.beans.factory.BeanFactoryAware
-
getExecutor
@Nullable public cn.taketoday.core.task.AsyncTaskExecutor getExecutor()Return the AsyncTaskExecutor to use for concurrent handling, ornullif none specified. -
onTimeout
Register code to invoke when the async request times out.This method is called from a container thread when an async request times out before the
Callablehas completed. The callback is executed in the same thread and therefore should return without blocking. It may return an alternative value to use, including anExceptionor returnRESULT_NONE. -
onError
Register code to invoke for an error during async request processing.This method is called from a container thread when an error occurred while processing an async request before the
Callablehas completed. The callback is executed in the same thread and therefore should return without blocking. It may return an alternative value to use, including anExceptionor returnRESULT_NONE. -
onCompletion
Register code to invoke when the async request completes.This method is called from a container thread when an async request completed for any reason, including timeout and network error.
-
getInterceptor
CallableProcessingInterceptor getInterceptor()
-