RESOLVED - BATCH-838: TimeoutTerminationPolicy does not terminate when eof is encountered
terminate immediately if exit status is not continuable
This commit is contained in:
@@ -30,13 +30,19 @@ import org.springframework.batch.repeat.context.RepeatContextSupport;
|
||||
public class CompletionPolicySupport implements CompletionPolicy {
|
||||
|
||||
/**
|
||||
* Delegate to {@link #isComplete(RepeatContext)}.
|
||||
* If exit status is not continuable return <code>true</code>, otherwise
|
||||
* delegate to {@link #isComplete(RepeatContext)}.
|
||||
*
|
||||
* @see org.springframework.batch.repeat.CompletionPolicy#isComplete(org.springframework.batch.repeat.RepeatContext,
|
||||
* ExitStatus)
|
||||
*/
|
||||
public boolean isComplete(RepeatContext context, ExitStatus result) {
|
||||
return isComplete(context);
|
||||
if (result != null && !result.isContinuable()) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return isComplete(context);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -64,6 +64,7 @@ public class TimeoutTerminationPolicy extends CompletionPolicySupport {
|
||||
*
|
||||
* @see org.springframework.batch.repeat.CompletionPolicy#isComplete(org.springframework.batch.repeat.RepeatContext)
|
||||
*/
|
||||
@Override
|
||||
public boolean isComplete(RepeatContext context) {
|
||||
return ((TimeoutBatchContext) context).isComplete();
|
||||
}
|
||||
@@ -73,6 +74,7 @@ public class TimeoutTerminationPolicy extends CompletionPolicySupport {
|
||||
*
|
||||
* @see org.springframework.batch.repeat.CompletionPolicy#start(RepeatContext)
|
||||
*/
|
||||
@Override
|
||||
public RepeatContext start(RepeatContext context) {
|
||||
return new TimeoutBatchContext(context);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user