Codota Logo
org.springframework.retry.support
Code IndexAdd Codota to your IDE (free)

How to use org.springframework.retry.support

Best Java code snippets using org.springframework.retry.support (Showing top 20 results out of 540)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-retry

/**
 * Execute the simulator for a give # of iterations.
 *
 * @param numSimulations  Number of simulations to run
 * @return the outcome of all simulations
 */
public RetrySimulation executeSimulation(int numSimulations) {
  RetrySimulation simulation = new RetrySimulation();
  for (int i=0; i<numSimulations; i++) {
    simulation.addSequence(executeSingleSimulation());
  }
  return simulation;
}
origin: spring-projects/spring-batch

@Override
protected boolean canRetry(RetryPolicy retryPolicy, RetryContext context) {
  BatchRetryContext batchContext = (BatchRetryContext) context;
  for (RetryContext nextContext : batchContext.contexts) {
    if (!super.canRetry(retryPolicy, nextContext)) {
      return false;
    }
  }
  return true;
}
origin: spring-projects/spring-batch

@Override
public final <T, E extends Throwable> T execute(RetryCallback<T, E> retryCallback, RecoveryCallback<T> recoveryCallback,
    RetryState retryState) throws E {
  return regular.execute(retryCallback, recoveryCallback, retryState);
}
origin: spring-projects/spring-retry

public StatefulRetryOperationsInterceptor() {
  RetryTemplate retryTemplate = new RetryTemplate();
  retryTemplate.setRetryPolicy(new NeverRetryPolicy());
  this.retryOperations = retryTemplate;
}
origin: spring-projects/spring-retry

private RetryTemplate createTemplate(String[] listenersBeanNames) {
  RetryTemplate template = new RetryTemplate();
  if (listenersBeanNames.length > 0) {
    template.setListeners(getListenersBeans(listenersBeanNames));
  } else if (globalListeners !=null) {
    template.setListeners(globalListeners);
  }
  return template;
}
origin: spring-projects/spring-batch

  @Override
  public String doInTransaction(TransactionStatus status) {
    try {
      return retryTemplate.execute(callback, recoveryCallback, new DefaultRetryState(item));
    }
    catch (Exception e) {
      throw new RuntimeException(e.getMessage(), e);
    }
  }
});
origin: spring-projects/spring-batch

public void setRetryPolicy(RetryPolicy retryPolicy) {
  this.retryPolicy = retryPolicy;
  delegate.setRetryPolicy(retryPolicy);
  regular.setRetryPolicy(retryPolicy);
}
origin: spring-projects/spring-batch

@Override
protected RetryContext open(RetryPolicy retryPolicy, RetryState state) {
  BatchRetryState batchState = (BatchRetryState) state;
  Collection<RetryContext> contexts = new ArrayList<>();
  for (RetryState retryState : batchState.keys) {
    contexts.add(super.open(retryPolicy, retryState));
  }
  return new BatchRetryContext(RetrySynchronizationManager.getContext(), contexts);
}
origin: spring-projects/spring-retry

/**
 * Execute the callback once if the policy dictates that we can, re-throwing any
 * exception encountered so that clients can re-present the same task later.
 *
 * @see RetryOperations#execute(RetryCallback, RetryState)
 * @param retryCallback the {@link RetryCallback}
 * @param retryState the {@link RetryState}
 * @throws ExhaustedRetryException if the retry has been exhausted.
 */
@Override
public final <T, E extends Throwable> T execute(RetryCallback<T, E> retryCallback,
    RetryState retryState) throws E, ExhaustedRetryException {
  return doExecute(retryCallback, null, retryState);
}
origin: spring-projects/spring-retry

/**
 * @return the longest total time slept by a retry sequence.
 */
public SleepSequence getLongestTotalSleepSequence() {
  SleepSequence longest = null;
  for (SleepSequence sequence : sleepSequences) {
    if (longest == null || sequence.getTotalSleep() > longest.getTotalSleep()) {
      longest = sequence;
    }
  }
  return longest;
}
origin: spring-projects/spring-retry

  public Object doWithRetry(RetryContext context) throws Exception {
    throw new FailingRetryException();
  }
}
origin: spring-projects/spring-retry

private RetryContext doOpenInternal(RetryPolicy retryPolicy) {
  return doOpenInternal(retryPolicy, null);
}
origin: spring-projects/spring-retry

/**
 * Add a sequence of sleeps to the simulation.
 * @param sleeps the times to be created as a {@link SleepSequence}
 */
public void addSequence(List<Long> sleeps) {
  sleepHistogram.addAll(sleeps);
  sleepSequences.add(new SleepSequence(sleeps));
}
origin: spring-projects/spring-retry

protected void registerThrowable(RetryPolicy retryPolicy, RetryState state,
    RetryContext context, Throwable e) {
  retryPolicy.registerThrowable(context, e);
  registerContext(context, state);
}
origin: spring-projects/spring-batch

@Override
public final <T, E extends Throwable> T execute(RetryCallback<T, E> retryCallback, RetryState retryState) throws E,
ExhaustedRetryException {
  return regular.execute(retryCallback, retryState);
}
origin: spring-projects/spring-retry

/**
 * Execute the callback once if the policy dictates that we can, re-throwing any
 * exception encountered so that clients can re-present the same task later.
 *
 * @see RetryOperations#execute(RetryCallback, RetryState)
 * @param retryCallback the {@link RetryCallback}
 * @param recoveryCallback the {@link RecoveryCallback}
 * @param retryState the {@link RetryState}
 */
@Override
public final <T, E extends Throwable> T execute(RetryCallback<T, E> retryCallback,
    RecoveryCallback<T> recoveryCallback, RetryState retryState)
    throws E, ExhaustedRetryException {
  return doExecute(retryCallback, recoveryCallback, retryState);
}
origin: spring-projects/spring-batch

@Override
public final <T, E extends Throwable> T execute(RetryCallback<T, E> retryCallback, RecoveryCallback<T> recoveryCallback) throws E {
  return regular.execute(retryCallback, recoveryCallback);
}
origin: spring-projects/spring-retry

/**
 * Keep executing the callback until it either succeeds or the policy dictates that we
 * stop, in which case the recovery callback will be executed.
 *
 * @see RetryOperations#execute(RetryCallback, RecoveryCallback)
 * @param retryCallback the {@link RetryCallback}
 * @param recoveryCallback the {@link RecoveryCallback}
 * @throws TerminatedRetryException if the retry has been manually terminated by a
 * listener.
 */
@Override
public final <T, E extends Throwable> T execute(RetryCallback<T, E> retryCallback,
    RecoveryCallback<T> recoveryCallback) throws E {
  return doExecute(retryCallback, recoveryCallback, null);
}
origin: spring-projects/spring-batch

@Override
public final <T, E extends Throwable> T execute(RetryCallback<T, E> retryCallback) throws E {
  return regular.execute(retryCallback);
}
origin: spring-projects/spring-retry

/**
 * Keep executing the callback until it either succeeds or the policy dictates that we
 * stop, in which case the most recent exception thrown by the callback will be
 * rethrown.
 *
 * @see RetryOperations#execute(RetryCallback)
 * @param retryCallback the {@link RetryCallback}
 *
 * @throws TerminatedRetryException if the retry has been manually terminated by a
 * listener.
 */
@Override
public final <T, E extends Throwable> T execute(RetryCallback<T, E> retryCallback)
    throws E {
  return doExecute(retryCallback, null, null);
}
org.springframework.retry.support

Most used classes

  • RetryTemplate
    Template class that simplifies the execution of operations with retry semantics. Retryable operatio
  • DefaultRetryState
  • RetrySynchronizationManager
    Global variable support for retry clients. Normally it is not necessary for clients to be aware of t
  • RetrySimulation$SleepSequence
  • RetrySimulation
    The results of a simulation.
  • RetrySimulator$FailingRetryException,
  • RetrySimulator$StealingSleeper,
  • RetrySimulator
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now