Example usage for org.springframework.messaging.handler.invocation HandlerMethodReturnValueHandler handleReturnValue

List of usage examples for org.springframework.messaging.handler.invocation HandlerMethodReturnValueHandler handleReturnValue

Introduction

In this page you can find the example usage for org.springframework.messaging.handler.invocation HandlerMethodReturnValueHandler handleReturnValue.

Prototype

void handleReturnValue(@Nullable Object returnValue, MethodParameter returnType, Message<?> message)
        throws Exception;

Source Link

Document

Handle the given return value.

Usage

From source file:org.springframework.messaging.handler.invocation.HandlerMethodReturnValueHandlerComposite.java

@Override
public void handleReturnValue(@Nullable Object returnValue, MethodParameter returnType, Message<?> message)
        throws Exception {

    HandlerMethodReturnValueHandler handler = getReturnValueHandler(returnType);
    if (handler == null) {
        throw new IllegalStateException("No handler for return value type: " + returnType.getParameterType());
    }/*  w  ww  . j a v  a 2s . co  m*/
    if (logger.isTraceEnabled()) {
        logger.trace("Processing return value with " + handler);
    }
    handler.handleReturnValue(returnValue, returnType, message);
}