protected void processHandlerMethodException(HandlerMethod handlerMethod, Exception exception, Message<?> message) { InvocableHandlerMethod invocable = getExceptionHandlerMethod(handlerMethod, exception); if (invocable == null) { logger.error("Unhandled exception from message handler method", exception); return; } invocable.setMessageMethodArgumentResolvers(this.argumentResolvers); if (logger.isDebugEnabled()) { logger.debug("Invoking " + invocable.getShortLogMessage()); } try { Throwable cause = exception.getCause(); Object returnValue = (cause != null ? invocable.invoke(message, exception, cause, handlerMethod) : invocable.invoke(message, exception, 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); } }
@Override protected Object preProcessResponse(Object result) { MethodParameter returnType = getHandlerMethod().getReturnType(); if (result instanceof Message) { return MessageBuilder.fromMessage((Message<?>) result) .setHeader(AbstractMessageSendingTemplate.CONVERSION_HINT_HEADER, returnType).build(); } return MessageBuilder.withPayload(result).setHeader( AbstractMessageSendingTemplate.CONVERSION_HINT_HEADER, returnType).build(); }
protected void processHandlerMethodException(HandlerMethod handlerMethod, Exception exception, Message<?> message) { InvocableHandlerMethod invocable = getExceptionHandlerMethod(handlerMethod, exception); if (invocable == null) { logger.error("Unhandled exception from message handler method", exception); return; } invocable.setMessageMethodArgumentResolvers(this.argumentResolvers); if (logger.isDebugEnabled()) { logger.debug("Invoking " + invocable.getShortLogMessage()); } try { Throwable cause = exception.getCause(); Object returnValue = (cause != null ? invocable.invoke(message, exception, cause, handlerMethod) : invocable.invoke(message, exception, 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); } }
protected void processHandlerMethodException(HandlerMethod handlerMethod, Exception exception, Message<?> message) { InvocableHandlerMethod invocable = getExceptionHandlerMethod(handlerMethod, exception); if (invocable == null) { logger.error("Unhandled exception from message handler method", exception); return; } invocable.setMessageMethodArgumentResolvers(this.argumentResolvers); if (logger.isDebugEnabled()) { logger.debug("Invoking " + invocable.getShortLogMessage()); } try { Throwable cause = exception.getCause(); Object returnValue = (cause != null ? invocable.invoke(message, exception, cause, handlerMethod) : invocable.invoke(message, exception, 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); } }
protected void processHandlerMethodException(HandlerMethod handlerMethod, Exception exception, Message<?> message) { InvocableHandlerMethod invocable = getExceptionHandlerMethod(handlerMethod, exception); if (invocable == null) { logger.error("Unhandled exception from message handler method", exception); return; } invocable.setMessageMethodArgumentResolvers(this.argumentResolvers); if (logger.isDebugEnabled()) { logger.debug("Invoking " + invocable.getShortLogMessage()); } try { Throwable cause = exception.getCause(); Object returnValue = (cause != null ? invocable.invoke(message, exception, cause, handlerMethod) : invocable.invoke(message, exception, 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); } }
@Override protected Object preProcessResponse(Object result) { MethodParameter returnType = this.handlerMethod.getReturnType(); if (result instanceof Message) { return MessageBuilder.fromMessage((Message<?>) result) .setHeader(AbstractMessageSendingTemplate.CONVERSION_HINT_HEADER, returnType).build(); } return MessageBuilder.withPayload(result).setHeader( AbstractMessageSendingTemplate.CONVERSION_HINT_HEADER, returnType).build(); }
@Override protected Object preProcessResponse(Object result) { MethodParameter returnType = getHandlerMethod().getReturnType(); if (result instanceof Message) { return MessageBuilder.fromMessage((Message<?>) result) .setHeader(AbstractMessageSendingTemplate.CONVERSION_HINT_HEADER, returnType).build(); } return MessageBuilder.withPayload(result).setHeader( AbstractMessageSendingTemplate.CONVERSION_HINT_HEADER, returnType).build(); }