Top Description Constructors Methods
org.springframework.messaging.handler.invocation

public abstract Class AbstractAsyncReturnValueHandler

extends Object
implements AsyncHandlerMethodReturnValueHandler
Class Inheritance
All Implemented Interfaces
org.springframework.messaging.handler.invocation.AsyncHandlerMethodReturnValueHandler, org.springframework.messaging.handler.invocation.HandlerMethodReturnValueHandler
Known Direct Subclasses
org.springframework.messaging.handler.invocation.CompletableFutureReturnValueHandler, org.springframework.messaging.handler.invocation.ListenableFutureReturnValueHandler, org.springframework.messaging.handler.invocation.ReactiveReturnValueHandler
Imports
org.springframework.core.MethodParameter, org.springframework.lang.Nullable, org.springframework.messaging.Message

Convenient base class for AsyncHandlerMethodReturnValueHandler implementations that support only asynchronous (Future-like) return values and merely serve as adapters of such types to Spring's ListenableFuture.
Author
Sebastien Deleuze
Since
4.2

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
handleReturnValue(Object
the value returned from the handler method
returnValue
,
MethodParameter
the type of the return value. This type must have previously been passed to supportsReturnType(org.springframework.core.MethodParameter) and it must have returned true.
returnType
,
Message<?>
the message that caused this method to be called
message
)

Implements org.springframework.messaging.handler.invocation.HandlerMethodReturnValueHandler.handleReturnValue.

Handle the given return value.

public boolean
isAsyncReturnValue(Object
the value returned from the handler method
returnValue
,
MethodParameter
the type of the return value
returnType
)

Implements org.springframework.messaging.handler.invocation.AsyncHandlerMethodReturnValueHandler.isAsyncReturnValue.

Whether the return value represents an asynchronous, Future-like type with success and error callbacks.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AbstractAsyncReturnValueHandlerback to summary
public AbstractAsyncReturnValueHandler()

Method Detail

handleReturnValueback to summary
public void handleReturnValue(Object returnValue, MethodParameter returnType, Message<?> message)

Implements org.springframework.messaging.handler.invocation.HandlerMethodReturnValueHandler.handleReturnValue.

Doc from org.springframework.messaging.handler.invocation.HandlerMethodReturnValueHandler.handleReturnValue.

Handle the given return value.

Parameters
returnValue:Object

the value returned from the handler method

returnType:MethodParameter

the type of the return value. This type must have previously been passed to supportsReturnType(org.springframework.core.MethodParameter) and it must have returned true.

message:Message<?>

the message that caused this method to be called

Annotations
@Override
isAsyncReturnValueback to summary
public boolean isAsyncReturnValue(Object returnValue, MethodParameter returnType)

Implements org.springframework.messaging.handler.invocation.AsyncHandlerMethodReturnValueHandler.isAsyncReturnValue.

Doc from org.springframework.messaging.handler.invocation.AsyncHandlerMethodReturnValueHandler.isAsyncReturnValue.

Whether the return value represents an asynchronous, Future-like type with success and error callbacks. If this method returns true, then toCompletableFuture is invoked next. If it returns false, then handleReturnValue is called.

Note

this method will only be invoked after supportsReturnType(org.springframework.core.MethodParameter) is called and it returns true.

Parameters
returnValue:Object

the value returned from the handler method

returnType:MethodParameter

the type of the return value

Returns:boolean

true if the return value type represents an async value

Annotations
@Override