Add trySet method to DeferredResult

The method absorbs any potential StaleAsyncWebRequestException and
returns false instead.

Issue: SPR-8517
This commit is contained in:
Rossen Stoyanchev
2012-05-11 16:06:18 -04:00
parent 897f6d6c68
commit c57d4e2386
2 changed files with 21 additions and 4 deletions

View File

@@ -388,10 +388,11 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter i
}
/**
* Set an AsyncTaskExecutor to use when a controller method returns a Callable.
* <p>The default is a {@link SimpleAsyncTaskExecutor}
*
* TODO... need a better default
* Set the AsyncTaskExecutor to use when a controller method returns a
* {@code Callable}.
* <p>The default instance type is a {@link SimpleAsyncTaskExecutor}.
* It's recommended to change that default in production as the simple
* executor does not re-use threads.
*/
public void setAsyncTaskExecutor(AsyncTaskExecutor taskExecutor) {
this.taskExecutor = taskExecutor;