Package org.springframework.batch.repeat.context

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


    @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

  }

  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

Related Classes of org.springframework.batch.repeat.context.RepeatContextCounter

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.