IN PROGRESS - issue BATCH-894: RFC: move ExitStatus up into Core?
Change Tasklet to use RepeatStatus instead of ExitStatus to signal continuable status
This commit is contained in:
@@ -86,7 +86,7 @@ public class ChunkMessageChannelItemWriter<T> extends StepExecutionListenerSuppo
|
||||
@Override
|
||||
public ExitStatus afterStep(StepExecution stepExecution) {
|
||||
if (!(stepExecution.getStatus() == BatchStatus.COMPLETED)) {
|
||||
return ExitStatus.CONTINUABLE;
|
||||
return ExitStatus.EXECUTING;
|
||||
}
|
||||
long expecting = localState.getExpecting();
|
||||
boolean timedOut;
|
||||
|
||||
@@ -50,7 +50,7 @@ public class ChunkProcessorChunkHandler<S> implements ChunkHandler<S>, Initializ
|
||||
}
|
||||
|
||||
logger.debug("Completed chunk handling with " + skipCount + " skips");
|
||||
return new ChunkResponse(ExitStatus.CONTINUABLE, chunkRequest.getJobId(), skipCount);
|
||||
return new ChunkResponse(ExitStatus.EXECUTING, chunkRequest.getJobId(), skipCount);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class ChunkProcessorChunkHandlerTests {
|
||||
12L, 10));
|
||||
assertEquals(0, response.getSkipCount());
|
||||
assertEquals(new Long(12L), response.getJobId());
|
||||
assertEquals(ExitStatus.CONTINUABLE, response.getExitStatus());
|
||||
assertEquals(ExitStatus.EXECUTING, response.getExitStatus());
|
||||
assertEquals(2, count);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.batch.integration.job;
|
||||
import org.springframework.batch.core.ExitStatus;
|
||||
import org.springframework.batch.core.StepContribution;
|
||||
import org.springframework.batch.core.step.tasklet.Tasklet;
|
||||
import org.springframework.batch.repeat.RepeatStatus;
|
||||
import org.springframework.core.AttributeAccessor;
|
||||
|
||||
/**
|
||||
@@ -30,8 +31,9 @@ public class TestTasklet implements Tasklet {
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*/
|
||||
public ExitStatus execute(StepContribution contribution, AttributeAccessor attributes) throws Exception {
|
||||
return ExitStatus.FINISHED;
|
||||
public RepeatStatus execute(StepContribution contribution, AttributeAccessor attributes) throws Exception {
|
||||
contribution.setExitStatus(ExitStatus.FINISHED);
|
||||
return RepeatStatus.FINISHED;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user