Package org.springframework.retry

Examples of org.springframework.retry.RetryException


  protected void registerThrowable(RetryPolicy retryPolicy, RetryState state,
      RetryContext context, Throwable e) {
    if (state != null) {
      Object key = state.getKey();
      if (context.getRetryCount() > 0 && !retryContextCache.containsKey(key)) {
        throw new RetryException(
            "Inconsistent state for failed item key: cache key has changed. "
                + "Consider whether equals() or hashCode() for the key might be inconsistent, "
                + "or if you need to supply a better key");
      }
      retryContextCache.put(key, context);
View Full Code Here


    }

    RetryContext context = retryContextCache.get(key);
    if (context == null) {
      if (retryContextCache.containsKey(key)) {
        throw new RetryException(
            "Inconsistent state for failed item: no history found. "
                + "Consider whether equals() or hashCode() for the item might be inconsistent, "
                + "or if you need to supply a better ItemKeyGenerator");
      }
      // The cache could have been expired in between calls to
View Full Code Here

      @SuppressWarnings("unchecked")
      E rethrow = (E) throwable;
      return rethrow;
    }
    else {
      throw new RetryException("Exception in batch process", throwable);
    }
  }
View Full Code Here

        }
        else {
          if (rollbackClassifier.classify(e)) {
            // Default is to rollback unless the classifier
            // allows us to continue
            throw new RetryException("Non-skippable exception in recoverer while reading", e);
          }

          throw new BatchRuntimeException(e);
        }
      }
View Full Code Here

        }
        else {
          if (rollbackClassifier.classify(e)) {
            // Default is to rollback unless the classifier
            // allows us to continue
            throw new RetryException("Non-skippable exception in recoverer while processing", e);
          }

          throw new BatchRuntimeException(e);
        }
      }
View Full Code Here

        }
        else {
          if (rollbackClassifier.classify(e)) {
            // Default is to rollback unless the classifier
            // allows us to continue
            throw new RetryException("Non-skippable exception in recoverer while write", e);
          }
          return null;
        }
      }
View Full Code Here

          }
          else {
            if (rollbackClassifier.classify(e)) {
              // Default is to rollback unless the classifier
              // allows us to continue
              throw new RetryException("Non-skippable exception in recoverer while processing", e);
            }
            iterator.remove(e);
            return null;
          }
        }
View Full Code Here

        @Override
        public Object recover(RetryContext context) throws Exception {

          Throwable e = context.getLastThrowable();
          if (outputs.size() > 1 && !rollbackClassifier.classify(e)) {
            throw new RetryException("Invalid retry state during write caused by "
                + "exception that does not classify for rollback: ", e);
          }

          Chunk<I>.ChunkIterator inputIterator = inputs.iterator();
          for (Chunk<O>.ChunkIterator outputIterator = outputs.iterator(); outputIterator.hasNext();) {

            inputIterator.next();
            outputIterator.next();

            checkSkipPolicy(inputIterator, outputIterator, e, contribution, true);
            if (!rollbackClassifier.classify(e)) {
              throw new RetryException(
                  "Invalid retry state during recovery caused by exception that does not classify for rollback: ",
                  e);
            }

          }
View Full Code Here

      logger.debug("Skipping after failed write", e);
    }
    else {
      if (recovery) {
        // Only if already recovering should we check skip policy
        throw new RetryException("Non-skippable exception in recoverer", e);
      }
      else {
        if (e instanceof Exception) {
          throw (Exception) e;
        }
        else if (e instanceof Error) {
          throw (Error) e;
        }
        else {
          throw new RetryException("Non-skippable throwable in recoverer", e);
        }
      }
    }
  }
View Full Code Here

import org.springframework.retry.RetryException;

public class RetryExceptionTests extends AbstractExceptionTests {

  public Exception getException(String msg) throws Exception {
    return new RetryException(msg);
  }
View Full Code Here

TOP

Related Classes of org.springframework.retry.RetryException

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.