OPEN - issue BATCH-814: JobRepository should not require Step or Job (only their names)
Fixed the step execution methods (not job execution yet)
This commit is contained in:
@@ -72,7 +72,7 @@ public class StepExecutionMessageHandler {
|
||||
StepExecution stepExecution = jobExecution.createStepExecution(step.getName());
|
||||
try {
|
||||
|
||||
StepExecution lastStepExecution = jobRepository.getLastStepExecution(jobInstance, step);
|
||||
StepExecution lastStepExecution = jobRepository.getLastStepExecution(jobInstance, step.getName());
|
||||
|
||||
// Even if it completed successfully we want to pass on the output
|
||||
// attributes, so set up the execution context here if it is
|
||||
@@ -176,7 +176,7 @@ public class StepExecutionMessageHandler {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (jobRepository.getStepExecutionCount(lastStepExecution.getJobExecution().getJobInstance(), step) < step
|
||||
if (jobRepository.getStepExecutionCount(lastStepExecution.getJobExecution().getJobInstance(), step.getName()) < step
|
||||
.getStartLimit()) {
|
||||
// step start count is less than start max, return true
|
||||
return true;
|
||||
|
||||
@@ -19,7 +19,6 @@ import org.springframework.batch.core.Job;
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.JobInstance;
|
||||
import org.springframework.batch.core.JobParameters;
|
||||
import org.springframework.batch.core.Step;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.core.repository.JobExecutionAlreadyRunningException;
|
||||
import org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException;
|
||||
@@ -43,14 +42,14 @@ public class JobRepositorySupport implements JobRepository {
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.batch.core.repository.JobRepository#getLastStepExecution(org.springframework.batch.core.JobInstance, org.springframework.batch.core.Step)
|
||||
*/
|
||||
public StepExecution getLastStepExecution(JobInstance jobInstance, Step step) {
|
||||
public StepExecution getLastStepExecution(JobInstance jobInstance, String stepName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.batch.core.repository.JobRepository#getStepExecutionCount(org.springframework.batch.core.JobInstance, org.springframework.batch.core.Step)
|
||||
*/
|
||||
public int getStepExecutionCount(JobInstance jobInstance, Step step) {
|
||||
public int getStepExecutionCount(JobInstance jobInstance, String stepName) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user