Class ListenableFutureReturnValueHandler
java.lang.Object
org.springframework.messaging.handler.invocation.AbstractAsyncReturnValueHandler
org.springframework.messaging.handler.invocation.ListenableFutureReturnValueHandler
- All Implemented Interfaces:
AsyncHandlerMethodReturnValueHandler
,HandlerMethodReturnValueHandler
@Deprecated(since="6.0",
forRemoval=true)
public class ListenableFutureReturnValueHandler
extends AbstractAsyncReturnValueHandler
Deprecated, for removal: This API element is subject to removal in a future version.
Support for
ListenableFuture
as a return value type.- Since:
- 4.2
- Author:
- Sebastien Deleuze
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionboolean
supportsReturnType
(MethodParameter returnType) Deprecated, for removal: This API element is subject to removal in a future version.Whether the given method return type is supported by this handler.toCompletableFuture
(Object returnValue, MethodParameter returnType) Deprecated, for removal: This API element is subject to removal in a future version.Adapt the asynchronous return value to aCompletableFuture
.toListenableFuture
(Object returnValue, MethodParameter returnType) Deprecated, for removal: This API element is subject to removal in a future version.Adapt the asynchronous return value to aListenableFuture
.Methods inherited from class org.springframework.messaging.handler.invocation.AbstractAsyncReturnValueHandler
handleReturnValue, isAsyncReturnValue
-
Constructor Details
-
ListenableFutureReturnValueHandler
public ListenableFutureReturnValueHandler()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
supportsReturnType
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:HandlerMethodReturnValueHandler
Whether the given method return type is supported by this handler.- Parameters:
returnType
- the method return type to check- Returns:
true
if this handler supports the supplied return type;false
otherwise
-
toListenableFuture
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:AsyncHandlerMethodReturnValueHandler
Adapt the asynchronous return value to aListenableFuture
.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 returnstrue
.- Parameters:
returnValue
- the value returned from the handler methodreturnType
- the type of the return value- Returns:
- the resulting ListenableFuture, or
null
in which case no further handling will be performed
-
toCompletableFuture
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:AsyncHandlerMethodReturnValueHandler
Adapt the asynchronous return value to aCompletableFuture
.Return value handling will then continue when the CompletableFuture 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
.- Parameters:
returnValue
- the value returned from the handler methodreturnType
- the type of the return value- Returns:
- the resulting CompletableFuture, or
null
in which case no further handling will be performed
-
CompletableFutureReturnValueHandler