Example usage for org.springframework.messaging.handler.invocation InvocableHandlerMethod getReturnType

List of usage examples for org.springframework.messaging.handler.invocation InvocableHandlerMethod getReturnType

Introduction

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

Prototype

public MethodParameter getReturnType() 

Source Link

Document

Return the HandlerMethod return type.

Usage

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

protected void processHandlerMethodException(HandlerMethod handlerMethod, Exception ex, Message<?> message) {
    InvocableHandlerMethod invocable = getExceptionHandlerMethod(handlerMethod, ex);
    if (invocable == null) {
        logger.error("Unhandled exception from message handler method", ex);
        return;//from w ww .  j a v a 2s.  c  om
    }
    invocable.setMessageMethodArgumentResolvers(this.argumentResolvers);
    if (logger.isDebugEnabled()) {
        logger.debug("Invoking " + invocable.getShortLogMessage());
    }
    try {
        Object returnValue = invocable.invoke(message, ex, handlerMethod);
        MethodParameter returnType = invocable.getReturnType();
        if (void.class == returnType.getParameterType()) {
            return;
        }
        this.returnValueHandlers.handleReturnValue(returnValue, returnType, message);
    } catch (Throwable ex2) {
        logger.error("Error while processing handler method exception", ex2);
    }
}