List of usage examples for org.springframework.batch.repeat RepeatContext getParent
RepeatContext getParent();
From source file:org.springframework.batch.core.step.item.SimpleRetryExceptionHandler.java
/** * Get the parent context (the retry is in an inner "chunk" loop and we want * the exception to be handled at the outer "step" level). * @return the {@link RepeatContext} that should hold the exhausted flag. *//* w w w . ja v a 2 s . c om*/ private RepeatContext getRepeatContext() { RepeatContext context = RepeatSynchronizationManager.getContext(); if (context.getParent() != null) { return context.getParent(); } return context; }
From source file:org.springframework.batch.repeat.support.RepeatTemplate.java
private boolean isMarkedComplete(RepeatContext context) { boolean complete = context.isCompleteOnly(); if (context.getParent() != null) { complete = complete || isMarkedComplete(context.getParent()); }/*from w w w . j ava 2s. c o m*/ if (complete) { logger.debug("Repeat is complete according to context alone."); } return complete; }