public class ListenableFutureReturnValueHandler extends AbstractAsyncReturnValueHandler
ListenableFuture as a return value type.| Constructor and Description |
|---|
ListenableFutureReturnValueHandler() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
supportsReturnType(MethodParameter returnType)
Whether the given method return type is
supported by this handler.
|
ListenableFuture<?> |
toListenableFuture(java.lang.Object returnValue,
MethodParameter returnType)
Adapt the asynchronous return value to a
ListenableFuture. |
handleReturnValue, isAsyncReturnValuepublic boolean supportsReturnType(MethodParameter returnType)
HandlerMethodReturnValueHandlerreturnType - the method return type to checktrue if this handler supports the supplied return type;
false otherwisepublic ListenableFuture<?> toListenableFuture(java.lang.Object returnValue, MethodParameter returnType)
AsyncHandlerMethodReturnValueHandlerListenableFuture.
Implementations should consider returning an instance of
SettableListenableFuture. 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 returns true.
returnValue - the value returned from the handler methodreturnType - the type of the return value.null in which case no
further handling will be performed.