/** * Invokes this method endpoint with the given arguments. * * @param args the arguments * @return the invocation result * @throws Exception when the method invocation results in an exception */ public Object invoke(Object... args) throws Exception { Object endpoint = bean; if (endpoint instanceof String) { String endpointName = (String) endpoint; endpoint = beanFactory.getBean(endpointName); } ReflectionUtils.makeAccessible(method); try { return method.invoke(endpoint, args); } catch (InvocationTargetException ex) { handleInvocationTargetException(ex); throw new IllegalStateException( "Unexpected exception thrown by method - " + ex.getTargetException().getClass().getName() + ": " + ex.getTargetException().getMessage()); } }
/** * Invokes this method endpoint with the given arguments. * * @param args the arguments * @return the invocation result * @throws Exception when the method invocation results in an exception */ public Object invoke(Object... args) throws Exception { Object endpoint = getBean(); ReflectionUtils.makeAccessible(method); try { return method.invoke(endpoint, args); } catch (InvocationTargetException ex) { handleInvocationTargetException(ex); throw new IllegalStateException( "Unexpected exception thrown by method - " + ex.getTargetException().getClass().getName() + ": " + ex.getTargetException().getMessage()); } }
/** * Invokes this method endpoint with the given arguments. * * @param args the arguments * @return the invocation result * @throws Exception when the method invocation results in an exception */ public Object invoke(Object... args) throws Exception { Object endpoint = getBean(); ReflectionUtils.makeAccessible(method); try { return method.invoke(endpoint, args); } catch (InvocationTargetException ex) { handleInvocationTargetException(ex); throw new IllegalStateException( "Unexpected exception thrown by method - " + ex.getTargetException().getClass().getName() + ": " + ex.getTargetException().getMessage()); } }
/** * Invokes this method endpoint with the given arguments. * * @param args the arguments * @return the invocation result * @throws Exception when the method invocation results in an exception */ public Object invoke(Object... args) throws Exception { Object endpoint = getBean(); ReflectionUtils.makeAccessible(method); try { return method.invoke(endpoint, args); } catch (InvocationTargetException ex) { handleInvocationTargetException(ex); throw new IllegalStateException( "Unexpected exception thrown by method - " + ex.getTargetException().getClass().getName() + ": " + ex.getTargetException().getMessage()); } }