public class DeferredResultMethodReturnValueHandler extends Object implements org.springframework.web.method.support.AsyncHandlerMethodReturnValueHandler
DeferredResult
, ListenableFuture
,
CompletionStage
and any other async type with a registered adapter
.Constructor and Description |
---|
DeferredResultMethodReturnValueHandler() |
Modifier and Type | Method and Description |
---|---|
Map<Class<?>,DeferredResultAdapter> |
getAdapterMap()
Return the map with
DeferredResult adapters. |
void |
handleReturnValue(Object returnValue,
org.springframework.core.MethodParameter returnType,
org.springframework.web.method.support.ModelAndViewContainer mavContainer,
org.springframework.web.context.request.NativeWebRequest webRequest) |
boolean |
isAsyncReturnValue(Object returnValue,
org.springframework.core.MethodParameter returnType) |
boolean |
supportsReturnType(org.springframework.core.MethodParameter returnType) |
public DeferredResultMethodReturnValueHandler()
public Map<Class<?>,DeferredResultAdapter> getAdapterMap()
DeferredResult
adapters.
By default the map contains adapters for DeferredResult
, which
simply downcasts, ListenableFuture
, and CompletionStage
.
public boolean supportsReturnType(org.springframework.core.MethodParameter returnType)
supportsReturnType
in interface org.springframework.web.method.support.HandlerMethodReturnValueHandler
public boolean isAsyncReturnValue(Object returnValue, org.springframework.core.MethodParameter returnType)
isAsyncReturnValue
in interface org.springframework.web.method.support.AsyncHandlerMethodReturnValueHandler
public void handleReturnValue(Object returnValue, org.springframework.core.MethodParameter returnType, org.springframework.web.method.support.ModelAndViewContainer mavContainer, org.springframework.web.context.request.NativeWebRequest webRequest) throws Exception
handleReturnValue
in interface org.springframework.web.method.support.HandlerMethodReturnValueHandler
Exception