类 AbstractAsyncReturnValueHandler
- java.lang.Object
- org.springframework.messaging.handler.invocation.AbstractAsyncReturnValueHandler
- 直接已知子类:
CompletableFutureReturnValueHandler
,ListenableFutureReturnValueHandler
,ReactiveReturnValueHandler
public abstract class AbstractAsyncReturnValueHandler extends Object implements AsyncHandlerMethodReturnValueHandler
Convenient base class forAsyncHandlerMethodReturnValueHandler
implementations that support only asynchronous (Future-like) return values and merely serve as adapters of such types to Spring'sListenableFuture
.- 从以下版本开始:
- 4.2
- 作者:
- Sebastien Deleuze
构造器概要
构造器 构造器 说明 AbstractAsyncReturnValueHandler()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
handleReturnValue(Object returnValue, MethodParameter returnType, Message<?> message)
Handle the given return value.boolean
isAsyncReturnValue(Object returnValue, MethodParameter returnType)
Whether the return value represents an asynchronous, Future-like type with success and error callbacks.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.messaging.handler.invocation.AsyncHandlerMethodReturnValueHandler
toListenableFuture
从接口继承的方法 org.springframework.messaging.handler.invocation.HandlerMethodReturnValueHandler
supportsReturnType
构造器详细资料
AbstractAsyncReturnValueHandler
public AbstractAsyncReturnValueHandler()
方法详细资料
isAsyncReturnValue
public boolean isAsyncReturnValue(Object returnValue, MethodParameter returnType)
从接口复制的说明:AsyncHandlerMethodReturnValueHandler
Whether the return value represents an asynchronous, Future-like type with success and error callbacks. If this method returnstrue
, thenAsyncHandlerMethodReturnValueHandler.toListenableFuture(java.lang.Object, org.springframework.core.MethodParameter)
is invoked next. If it returnsfalse
, thenHandlerMethodReturnValueHandler.handleReturnValue(java.lang.Object, org.springframework.core.MethodParameter, org.springframework.messaging.Message<?>)
is called.Note: this method will only be invoked after
HandlerMethodReturnValueHandler.supportsReturnType(org.springframework.core.MethodParameter)
is called and it returnstrue
.- 指定者:
isAsyncReturnValue
在接口中AsyncHandlerMethodReturnValueHandler
- 参数:
returnValue
- the value returned from the handler methodreturnType
- the type of the return value- 返回:
true
if the return value type represents an async value
handleReturnValue
public void handleReturnValue(@Nullable Object returnValue, MethodParameter returnType, Message<?> message)
从接口复制的说明:HandlerMethodReturnValueHandler
Handle the given return value.- 指定者:
handleReturnValue
在接口中HandlerMethodReturnValueHandler
- 参数:
returnValue
- the value returned from the handler methodreturnType
- the type of the return value. This type must have previously been passed toHandlerMethodReturnValueHandler.supportsReturnType(org.springframework.core.MethodParameter)
and it must have returnedtrue
.message
- the message that caused this method to be called