private JsonNode invoke(Object target, Method method, List<JsonNode> params) throws IOException, IllegalAccessException, InvocationTargetException {
		logger.debug("Invoking method: {} with args {}", method.getName(), params);

		Object result;

        if (method.getGenericParameterTypes().length == 1 && method.isVarArgs()) {
			Class<?> componentType = method.getParameterTypes()[0].getComponentType();
			result = componentType.isPrimitive() ?
				invokePrimitiveVarargs(target, method, params, componentType) :
				invokeNonPrimitiveVarargs(target, method, params, componentType);
        } else {
            Object[] convertedParams = convertJsonToParameters(method, params);
			if (convertedParameterTransformer != null) {
				convertedParams = convertedParameterTransformer.transformConvertedParameters(target, convertedParams);
			}
			result = method.invoke(target, convertedParams);
        }

		logger.debug("Invoked method: {}, result {}", method.getName(), result);

		return hasReturnValue(method) ? mapper.valueToTree(result) : null;
	}
private JsonNode invoke ( Object target , Method method , List < JsonNode > params ) throws IOException , IllegalAccessException , InvocationTargetException { logger . debug ( "Invoking method: {} with args {}" , method . getName ( ) , params ) ; Object result ; if ( method . getGenericParameterTypes ( ) . length == 1 && method . isVarArgs ( ) ) { Class < ? > componentType = method . getParameterTypes ( ) [ 0 ] . getComponentType ( ) ; result = componentType . isPrimitive ( ) ? invokePrimitiveVarargs ( target , method , params , componentType ) : invokeNonPrimitiveVarargs ( target , method , params , componentType ) ; } else { Object [ ] convertedParams = convertJsonToParameters ( method , params ) ; if ( convertedParameterTransformer != null ) { convertedParams = convertedParameterTransformer . transformConvertedParameters ( target , convertedParams ) ; } result = method . invoke ( target , convertedParams ) ; } logger . debug ( "Invoked method: {}, result {}" , method . getName ( ) , result ) ; return hasReturnValue ( method ) ? mapper . valueToTree ( result ) : null ; }
Invokes the given method on the {@code handler} passing
the given params (after converting them to beans\objects)
to it.

@param target optional service name used to locate the target object
to invoke the Method on
@param method the method to invoke
@param params the params to pass to the method
@return the return value (or null if no return)
@throws IOException               on error
@throws IllegalAccessException    on error
@throws InvocationTargetException on error