Examples of RepeatContextCounter


Examples of org.springframework.batch.repeat.context.RepeatContextCounter

    RepeatContextCounter counter;

    public CountingBatchContext(RepeatContext parent) {
      super(parent);
      counter = new RepeatContextCounter(this, COUNT, useParent);
    }
View Full Code Here

Examples of org.springframework.batch.repeat.context.RepeatContextCounter

    @Override
  public void handleException(RepeatContext context, Throwable throwable) throws Throwable {

    IntegerHolder key = exceptionClassifier.classify(throwable);

    RepeatContextCounter counter = getCounter(context, key);
    counter.increment();
    int count = counter.getCount();
    int threshold = key.getValue();
    if (count > threshold) {
      throw throwable;
    }
View Full Code Here

Examples of org.springframework.batch.repeat.context.RepeatContextCounter

  }

  private RepeatContextCounter getCounter(RepeatContext context, IntegerHolder key) {
    String attribute = RethrowOnThresholdExceptionHandler.class.getName() + "." + key;
    // Creates a new counter and stores it in the correct context:
    return new RepeatContextCounter(context, attribute, useParent);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.