private Object invokeAndGetResult(StepToken step, StepMatcher stepMatcher, StepInvoker foundStepInvoker) throws Exception { StepRetryDecorator retryInvoker = new StepRetryDecorator(foundStepInvoker); ResultWithRetryCount resultWithRetryCount = retryInvoker.invoke( step.getTokenId(), stepMatcher.getInvokerArgs() ); step.setRetryAttempts(resultWithRetryCount.getRetryAttempts()); return resultWithRetryCount.getResult(); }
public ResultWithRetryCount invoke(final String stepTokenId, List<String> args) throws Exception { ResultWithRetryCount result; StepRetry retry = foundStepInvoker.getRetry(); if ( retry.isValid()) { result = invokeWithRetry(stepTokenId, args, retry); } else { result = createResult(foundStepInvoker.invoke(stepTokenId, args), 0); } return result; }