类 ListenableFutureReturnValueHandler
- java.lang.Object
- org.springframework.messaging.handler.invocation.AbstractAsyncReturnValueHandler
- org.springframework.messaging.handler.invocation.ListenableFutureReturnValueHandler
public class ListenableFutureReturnValueHandler extends AbstractAsyncReturnValueHandler
Support forListenableFuture
as a return value type.- 从以下版本开始:
- 4.2
- 作者:
- Sebastien Deleuze
构造器概要
构造器 构造器 说明 ListenableFutureReturnValueHandler()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
supportsReturnType(MethodParameter returnType)
Whether the given method return type is supported by this handler.ListenableFuture<?>
toListenableFuture(Object returnValue, MethodParameter returnType)
Adapt the asynchronous return value to aListenableFuture
.从类继承的方法 org.springframework.messaging.handler.invocation.AbstractAsyncReturnValueHandler
handleReturnValue, isAsyncReturnValue
构造器详细资料
ListenableFutureReturnValueHandler
public ListenableFutureReturnValueHandler()
方法详细资料
supportsReturnType
public boolean supportsReturnType(MethodParameter returnType)
从接口复制的说明:HandlerMethodReturnValueHandler
Whether the given method return type is supported by this handler.- 参数:
returnType
- the method return type to check- 返回:
true
if this handler supports the supplied return type;false
otherwise
toListenableFuture
public ListenableFuture<?> toListenableFuture(Object returnValue, MethodParameter returnType)
从接口复制的说明:AsyncHandlerMethodReturnValueHandler
Adapt the asynchronous return value to aListenableFuture
. Implementations should consider returning an instance ofSettableListenableFuture
. Return value handling will then continue when the ListenableFuture is completed with either success or error.Note: this method will only be invoked after
HandlerMethodReturnValueHandler.supportsReturnType(org.springframework.core.MethodParameter)
is called and it returnstrue
.- 参数:
returnValue
- the value returned from the handler methodreturnType
- the type of the return value- 返回:
- the resulting ListenableFuture, or
null
in which case no further handling will be performed