接口 AsyncHandlerMethodReturnValueHandler
- 所有已知实现类:
AsyncTaskMethodReturnValueHandler
,CallableMethodReturnValueHandler
,CompletionStageReturnValueHandler
,DeferredResultMethodReturnValueHandler
,HandlerMethodReturnValueHandlerComposite
,ListenableFutureReturnValueHandler
,ResponseBodyEmitterReturnValueHandler
public interface AsyncHandlerMethodReturnValueHandler extends HandlerMethodReturnValueHandler
A return value handler that supports async types. Such return value types need to be handled with priority so the async value can be "unwrapped".Note: implementing this contract is not required but it should be implemented when the handler needs to be prioritized ahead of others. For example custom (async) handlers, by default ordered after built-in handlers, should take precedence over
@ResponseBody
or@ModelAttribute
handling, which should occur once the async value is ready. By contrast, built-in (async) handlers are already ordered ahead of sync handlers.- 从以下版本开始:
- 4.2
- 作者:
- Rossen Stoyanchev
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 boolean
isAsyncReturnValue(Object returnValue, MethodParameter returnType)
Whether the given return value represents asynchronous computation.从接口继承的方法 org.springframework.web.method.support.HandlerMethodReturnValueHandler
handleReturnValue, supportsReturnType
方法详细资料
isAsyncReturnValue
boolean isAsyncReturnValue(Object returnValue, MethodParameter returnType)
Whether the given return value represents asynchronous computation.- 参数:
returnValue
- the value returned from the handler methodreturnType
- the return type- 返回:
true
if the return value type represents an async value