Example usage for org.springframework.web.context.request.async WebAsyncTask WebAsyncTask

List of usage examples for org.springframework.web.context.request.async WebAsyncTask WebAsyncTask

Introduction

In this page you can find the example usage for org.springframework.web.context.request.async WebAsyncTask WebAsyncTask.

Prototype

public WebAsyncTask(Callable<V> callable) 

Source Link

Document

Create a WebAsyncTask wrapping the given Callable .

Usage

From source file:org.springframework.web.context.request.async.WebAsyncManager.java

/**
 * Start concurrent request processing and execute the given task with an
 * {@link #setTaskExecutor(AsyncTaskExecutor) AsyncTaskExecutor}. The result
 * from the task execution is saved and the request dispatched in order to
 * resume processing of that result. If the task raises an Exception then
 * the saved result will be the raised Exception.
 * @param callable a unit of work to be executed asynchronously
 * @param processingContext additional context to save that can be accessed
 * via {@link #getConcurrentResultContext()}
 * @throws Exception if concurrent processing failed to start
 * @see #getConcurrentResult()/*  ww w.  j  a va  2 s .  c om*/
 * @see #getConcurrentResultContext()
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public void startCallableProcessing(Callable<?> callable, Object... processingContext) throws Exception {
    Assert.notNull(callable, "Callable must not be null");
    startCallableProcessing(new WebAsyncTask(callable), processingContext);
}