Class HandlerMethodReturnValueHandlerComposite
java.lang.Object
org.springframework.messaging.handler.invocation.reactive.HandlerMethodReturnValueHandlerComposite
- All Implemented Interfaces:
HandlerMethodReturnValueHandler
public class HandlerMethodReturnValueHandlerComposite
extends Object
implements HandlerMethodReturnValueHandler
A HandlerMethodReturnValueHandler that wraps and delegates to others.
- Since:
- 5.2
- Author:
- Rossen Stoyanchev
-
Field Summary
FieldsFields inherited from interface org.springframework.messaging.handler.invocation.reactive.HandlerMethodReturnValueHandler
DATA_BUFFER_FACTORY_HEADER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddHandler(HandlerMethodReturnValueHandler returnValueHandler) Add the givenHandlerMethodReturnValueHandler.addHandlers(List<? extends HandlerMethodReturnValueHandler> handlers) Add the givenHandlerMethodReturnValueHandlers.voidclear()Clear the list of configured handlers.Return a read-only list with the configured handlers.reactor.core.publisher.Mono<Void>handleReturnValue(Object returnValue, MethodParameter returnType, Message<?> message) Handle the given return value.booleansupportsReturnType(MethodParameter returnType) Whether the given method return type is supported by this handler.
-
Field Details
-
logger
-
-
Constructor Details
-
HandlerMethodReturnValueHandlerComposite
public HandlerMethodReturnValueHandlerComposite()
-
-
Method Details
-
getReturnValueHandlers
Return a read-only list with the configured handlers. -
clear
public void clear()Clear the list of configured handlers. -
addHandler
public HandlerMethodReturnValueHandlerComposite addHandler(HandlerMethodReturnValueHandler returnValueHandler) Add the givenHandlerMethodReturnValueHandler. -
addHandlers
public HandlerMethodReturnValueHandlerComposite addHandlers(@Nullable List<? extends HandlerMethodReturnValueHandler> handlers) Add the givenHandlerMethodReturnValueHandlers. -
supportsReturnType
Description copied from interface:HandlerMethodReturnValueHandlerWhether the given method return type is supported by this handler.- Specified by:
supportsReturnTypein interfaceHandlerMethodReturnValueHandler- Parameters:
returnType- the method return type to check- Returns:
trueif this handler supports the supplied return type;falseotherwise
-
handleReturnValue
public reactor.core.publisher.Mono<Void> handleReturnValue(@Nullable Object returnValue, MethodParameter returnType, Message<?> message) Description copied from interface:HandlerMethodReturnValueHandlerHandle the given return value.- Specified by:
handleReturnValuein interfaceHandlerMethodReturnValueHandler- Parameters:
returnValue- the value returned from the handler methodreturnType- the type of the return value. This type must have previously been passed toHandlerMethodReturnValueHandler.supportsReturnType(MethodParameter)and it must have returnedtrue.- Returns:
Mono<Void>to indicate when handling is complete.
-