Make DeferredResult more usable and testable
DeferredResult now has a setErrorResult method that can be set to an Exception or an error object, error view, etc. The new isSetOrExpired() method can be used to check pro-actively if the DeferredResult is still usable or not. The setDeferredResultHandler method is now public so tests may use it. Issue: SPR-9690, SPR-9689
This commit is contained in:
@@ -705,7 +705,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter i
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Found concurrent result value [" + result + "]");
|
||||
}
|
||||
requestMappingMethod = requestMappingMethod.wrapConcurrentProcessingResult(result);
|
||||
requestMappingMethod = requestMappingMethod.wrapConcurrentResult(result);
|
||||
}
|
||||
|
||||
requestMappingMethod.invokeAndHandle(webRequest, mavContainer);
|
||||
|
||||
@@ -167,7 +167,7 @@ public class ServletInvocableHandlerMethod extends InvocableHandlerMethod {
|
||||
* from an async operation essentially either applying return value handling or
|
||||
* raising an exception if the end result is an Exception.
|
||||
*/
|
||||
ServletInvocableHandlerMethod wrapConcurrentProcessingResult(final Object result) {
|
||||
ServletInvocableHandlerMethod wrapConcurrentResult(final Object result) {
|
||||
|
||||
return new CallableHandlerMethod(new Callable<Object>() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user