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

public Interface HandlerMethodReturnValueHandler

Known Direct Subinterfaces
org.springframework.messaging.handler.invocation.AsyncHandlerMethodReturnValueHandler
Known Direct Implementers
org.springframework.messaging.simp.annotation.support.SendToMethodReturnValueHandler, org.springframework.messaging.simp.annotation.support.SubscriptionMethodReturnValueHandler
Imports
org.springframework.core.MethodParameter, org.springframework.lang.Nullable, org.springframework.messaging.Message

Strategy interface to handle the value returned from the invocation of a method handling a Message.
Author
Rossen Stoyanchev
Since
4.0

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
)

Handle the given return value.

public boolean

Returns:

true if this handler supports the supplied return type; false otherwise
supportsReturnType
(MethodParameter
the method return type to check
returnType
)

Whether the given method return type is supported by this handler.

Method Detail

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

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

Exceptions
Exception:
if the return value handling results in an error
supportsReturnTypeback to summary
public boolean supportsReturnType(MethodParameter returnType)

Whether the given method return type is supported by this handler.

Parameters
returnType:MethodParameter

the method return type to check

Returns:boolean

true if this handler supports the supplied return type; false otherwise