Interface HandlerMethodReturnValueHandler

All Known Implementing Classes:
AbstractEncoderMethodReturnValueHandler, HandlerMethodReturnValueHandlerComposite, RSocketPayloadReturnValueHandler

public interface HandlerMethodReturnValueHandler
Handle the return value from the invocation of an annotated Message handling method.
Since:
5.2
Author:
Rossen Stoyanchev
  • Field Details

    • DATA_BUFFER_FACTORY_HEADER

      static final String DATA_BUFFER_FACTORY_HEADER
      Header containing a DataBufferFactory for use in return value handling.
      See Also:
  • Method Details

    • supportsReturnType

      boolean supportsReturnType(MethodParameter returnType)
      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
    • handleReturnValue

      reactor.core.publisher.Mono<Void> handleReturnValue(@Nullable Object returnValue, MethodParameter returnType, Message<?> message)
      Handle the given return value.
      Parameters:
      returnValue - the value returned from the handler method
      returnType - the type of the return value. This type must have previously been passed to supportsReturnType(MethodParameter) and it must have returned true.
      Returns:
      Mono<Void> to indicate when handling is complete.