Package net.sf.sstk.retry

Examples of net.sf.sstk.retry.CleanUpStrategy


      if (definition.retryOn(lastEx)) {
        ArgumentSaver argSaver = definition.getArgumentSaver();
        CleanUpContext context = this.cleanUpContextFactory
            .createCleanUpContext(invocation.getMethod(), lastEx,
                argSaver);
        CleanUpStrategy strategy = definition.getCleanUpStrategy();
        if (strategy.giveUpTotaly(context)) {
          doLog("strategy says we should give up", exceptions);
          throw lastEx;
        }
        strategy.cleanUp(context);
        Object[] loadedArgs = argSaver.restoreArgs();
        try {
          return invocation.proceed(loadedArgs);
        } catch (Throwable ex) {
          exceptions.add(ex);
View Full Code Here


  }

  public RetryDefinition createDefinition(final Retry annotation,
      final BeanFactory beanFactory) {
    final ArgumentSaver argSaver = getArgSaver(annotation.argumentSaver());
    final CleanUpStrategy cleanUpStrategy = getCleanUpStrategy(annotation
        .cleanUpStrategy());
    return new SimpleRetryDefinition(argSaver, cleanUpStrategy, annotation
        .retryFor(), annotation.numberOfRetries());
  }
View Full Code Here

  /**
   * @param cleanUpStrategy
   * @return
   */
  protected CleanUpStrategy getCleanUpStrategy(final String cleanUpStrategy) {
    CleanUpStrategy strategy = getBean(cleanUpStrategy,
        CleanUpStrategy.class);
    if (strategy == null) {
      strategy = getWaitStrategy(cleanUpStrategy);
    }
    if (strategy == null) {
View Full Code Here

TOP

Related Classes of net.sf.sstk.retry.CleanUpStrategy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.