@Test(expected = IllegalArgumentException.class) public void execute2() { ServiceMethod method = MathService.createMathService().getServiceMethods().get("add"); Map<String, Object> parameters = new HashMap<>(); parameters.put("arg1", 1); parameters.put("arg2", "test"); method.executeSync(parameters); }
public Map<String, Object> executeSync(Map<String, Object> arguments) { if (arguments == null){ throw new IllegalArgumentException("Parameters should not be null."); } validateParameters(arguments); if (syncExecute) { try { return syncExecImpl(arguments); } catch (RuntimeException ex) { throw ex; } catch (Exception ex) { throw new RuntimeException("Method execution failed", ex); } } else if (asyncExecute) { return wrapAsSync(arguments); } else { throw new RuntimeException("Neither synchronous or asynchronous implementation was provided."); } }
ServiceMethod { public Map<String, Object> executeSync(Map<String, Object> arguments) { if (arguments == null){ throw new IllegalArgumentException("Parameters should not be null."); } validateParameters(arguments); if (syncExecute) { try { return syncExecImpl(arguments); } catch (RuntimeException ex) { throw ex; } catch (Exception ex) { throw new RuntimeException("Method execution failed", ex); } } else if (asyncExecute) { return wrapAsSync(arguments); } else { throw new RuntimeException("Neither synchronous or asynchronous implementation was provided."); } } }
ServiceMethod { public Map<String, Object> executeSync(Map<String, Object> arguments) { if (arguments == null){ throw new IllegalArgumentException("Parameters should not be null."); } validateParameters(arguments); if (syncExecute) { try { return syncExecImpl(arguments); } catch (RuntimeException ex) { throw ex; } catch (Exception ex) { throw new RuntimeException("Method execution failed", ex); } } else if (asyncExecute) { return wrapAsSync(arguments); } else { throw new RuntimeException("Neither synchronous or asynchronous implementation was provided."); } } ServiceMethod(ServiceMethodDescription serviceMethodDescription, ServiceDescription serviceDescription); }
ServiceMethod { public Map<String, Object> executeSync(Map<String, Object> arguments) { if (arguments == null){ throw new IllegalArgumentException("Parameters should not be null."); } validateParameters(arguments); if (syncExecute) { try { return syncExecImpl(arguments); } catch (RuntimeException ex) { throw ex; } catch (Exception ex) { throw new RuntimeException("Method execution failed", ex); } } else if (asyncExecute) { return wrapAsSync(arguments); } else { throw new RuntimeException("Neither synchronous or asynchronous implementation was provided."); } } ServiceMethod(ServiceMethodDescription serviceMethodDescription, ServiceDescription serviceDescription); final String getName(); final String getDescription(); List<DataDescription> getArguments(); Map<String, DataDescription> getArgumentMap(); List<DataDescription> getResults(); Map<String, DataDescription> getResultMap(); @Override String toString(); Map<String, Object> executeSync(Map<String, Object> arguments); void executeAsync(Map<String, Object> arguments, Consumer<Map<String, Object>> callback, Consumer<Exception> errorCallback); }
ServiceMethod { public Map<String, Object> executeSync(Map<String, Object> arguments) { if (arguments == null){ throw new IllegalArgumentException("Parameters should not be null."); } validateParameters(arguments); if (syncExecute) { try { return syncExecImpl(arguments); } catch (RuntimeException ex) { throw ex; } catch (Exception ex) { throw new RuntimeException("Method execution failed", ex); } } else if (asyncExecute) { return wrapAsSync(arguments); } else { throw new RuntimeException("Neither synchronous or asynchronous implementation was provided."); } } ServiceMethod(ServiceMethodDescription serviceMethodDescription, ServiceDescription serviceDescription); final String getName(); final String getDescription(); List<DataDescription> getArguments(); Map<String, DataDescription> getArgumentMap(); List<DataDescription> getResults(); Map<String, DataDescription> getResultMap(); @Override String toString(); Map<String, Object> executeSync(Map<String, Object> arguments); void executeAsync(Map<String, Object> arguments, Consumer<Map<String, Object>> callback, Consumer<Exception> errorCallback);  }