/** * Handle the return value for the given method endpoint. * <p/> * This implementation iterates over the set {@linkplain #setMethodReturnValueHandlers(java.util.List)} return value * handlers} to resolve the return value. * * @param messageContext the current message context * @param returnValue the return value * @param methodEndpoint the method endpoint to get arguments for * @throws Exception in case of errors */ protected void handleMethodReturnValue(MessageContext messageContext, Object returnValue, MethodEndpoint methodEndpoint) throws Exception { MethodParameter returnType = methodEndpoint.getReturnType(); for (MethodReturnValueHandler methodReturnValueHandler : methodReturnValueHandlers) { if (methodReturnValueHandler.supportsReturnType(returnType)) { methodReturnValueHandler.handleReturnValue(messageContext, returnType, returnValue); return; } } throw new IllegalStateException( "Return value [" + returnValue + "] not resolved by any MethodReturnValueHandler"); } }
/** * Handle the return value for the given method endpoint. * * <p>This implementation iterates over the set {@linkplain #setMethodReturnValueHandlers(java.util.List)} return value * handlers} to resolve the return value. * * @param messageContext the current message context * @param returnValue the return value * @param methodEndpoint the method endpoint to get arguments for * @throws Exception in case of errors */ protected void handleMethodReturnValue(MessageContext messageContext, Object returnValue, MethodEndpoint methodEndpoint) throws Exception { MethodParameter returnType = methodEndpoint.getReturnType(); for (MethodReturnValueHandler methodReturnValueHandler : methodReturnValueHandlers) { if (methodReturnValueHandler.supportsReturnType(returnType)) { methodReturnValueHandler.handleReturnValue(messageContext, returnType, returnValue); return; } } throw new IllegalStateException( "Return value [" + returnValue + "] not resolved by any MethodReturnValueHandler"); } }
/** * Handle the return value for the given method endpoint. * * <p>This implementation iterates over the set {@linkplain #setMethodReturnValueHandlers(java.util.List)} return value * handlers} to resolve the return value. * * @param messageContext the current message context * @param returnValue the return value * @param methodEndpoint the method endpoint to get arguments for * @throws Exception in case of errors */ protected void handleMethodReturnValue(MessageContext messageContext, Object returnValue, MethodEndpoint methodEndpoint) throws Exception { MethodParameter returnType = methodEndpoint.getReturnType(); for (MethodReturnValueHandler methodReturnValueHandler : methodReturnValueHandlers) { if (methodReturnValueHandler.supportsReturnType(returnType)) { methodReturnValueHandler.handleReturnValue(messageContext, returnType, returnValue); return; } } throw new IllegalStateException( "Return value [" + returnValue + "] not resolved by any MethodReturnValueHandler"); } }
/** * Handle the return value for the given method endpoint. * * <p>This implementation iterates over the set {@linkplain #setMethodReturnValueHandlers(java.util.List)} return value * handlers} to resolve the return value. * * @param messageContext the current message context * @param returnValue the return value * @param methodEndpoint the method endpoint to get arguments for * @throws Exception in case of errors */ protected void handleMethodReturnValue(MessageContext messageContext, Object returnValue, MethodEndpoint methodEndpoint) throws Exception { MethodParameter returnType = methodEndpoint.getReturnType(); for (MethodReturnValueHandler methodReturnValueHandler : methodReturnValueHandlers) { if (methodReturnValueHandler.supportsReturnType(returnType)) { methodReturnValueHandler.handleReturnValue(messageContext, returnType, returnValue); return; } } throw new IllegalStateException( "Return value [" + returnValue + "] not resolved by any MethodReturnValueHandler"); } }
@Override protected boolean supportsInternal(MethodEndpoint methodEndpoint) { return supportsParameters(methodEndpoint.getMethodParameters()) && supportsReturnType(methodEndpoint.getReturnType()); }
@Override protected boolean supportsInternal(MethodEndpoint methodEndpoint) { return supportsParameters(methodEndpoint.getMethodParameters()) && supportsReturnType(methodEndpoint.getReturnType()); }
@Override protected boolean supportsInternal(MethodEndpoint methodEndpoint) { return supportsParameters(methodEndpoint.getMethodParameters()) && supportsReturnType(methodEndpoint.getReturnType()); }
@Override protected boolean supportsInternal(MethodEndpoint methodEndpoint) { return supportsParameters(methodEndpoint.getMethodParameters()) && supportsReturnType(methodEndpoint.getReturnType()); }