default boolean isValid() { return isValidRetry(getDuration(), getInterval()); }
private ResultWithRetryCount invokeWithRetry(final String stepTokenId, List<String> args, StepRetry retry) { Object result; if ( log.isTraceEnabled()) { log.trace("Wrapping step " + foundStepInvoker.getStepPattern() + " with a StepRetry decorator"); } long duration = retry.getDuration(); long interval = retry.getInterval(); UntilFirstPassInvoker i = new UntilFirstPassInvoker(foundStepInvoker, duration, MILLISECONDS, interval); result = i.invoke(stepTokenId, args); return createResult(result, i.getRetryAttempts()); } }
public static StepRetry createStepRetry(long retryDuration, long retryInterval) { return StepRetry.isValidRetry(retryDuration, retryInterval) ? new DefaultStepRetry(retryDuration, retryInterval) : StepRetry.NO_RETRY; }
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; }
private void publishStep(StepInvoker invoker) { PublishStepMessage publishStepMessage = new PublishStepMessage( invoker.getId(), chorusClientId, invoker.getStepPattern().toString(), invoker.isPending(), invoker.getPendingMessage() == null ? Step.NO_PENDING_MESSAGE : invoker.getPendingMessage(), invoker.getTechnicalDescription(), invoker.getRetry().getDuration(), invoker.getRetry().getInterval() ); chorusWebSocketClient.sendMessage(publishStepMessage); }
/** * a map of properties representing a step invoker exported over the network using RMI protocol, * or null if the step invoker cannot be converted for remoting */ public JmxInvokerResult(StepInvoker i) { put(API_VERSION, ApiVersion.API_VERSION); put(STEP_ID, i.getId()); put(PENDING_MSG, i.getPendingMessage()); put(IS_PENDING, i.isPending()); put(PATTERN, i.getStepPattern().toString()); put(TECHNICAL_DESCRIPTION, i.getTechnicalDescription()); put(RETRY_DURATION, i.getRetry().getDuration()); put(RETRY_INTERVAL, i.getRetry().getInterval()); put(IS_DEPRECATED, i.isDeprecated()); }