RESOLVED - issue BATCH-464: Throw exception if restart is attempted on job instance that was already completed successfully

This commit is contained in:
dsyer
2008-03-14 17:09:26 +00:00
parent db2344d2fa
commit ec2c66885d
9 changed files with 144 additions and 54 deletions

View File

@@ -23,13 +23,11 @@ import java.util.Map.Entry;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.quartz.JobExecutionContext;
import org.springframework.batch.core.JobExecutionException;
import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.JobParametersBuilder;
import org.springframework.batch.core.configuration.JobLocator;
import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.batch.core.repository.JobExecutionAlreadyRunningException;
import org.springframework.batch.core.repository.JobRestartException;
import org.springframework.batch.core.repository.NoSuchJobException;
import org.springframework.scheduling.quartz.QuartzJobBean;
/**
@@ -73,13 +71,7 @@ public class JobLauncherDetails extends QuartzJobBean {
try {
jobLauncher.run(jobLocator.getJob(jobName), jobParameters);
}
catch (JobExecutionAlreadyRunningException e) {
log.error("Could not execute job.", e);
}
catch (JobRestartException e) {
log.error("Could not execute job.", e);
}
catch (NoSuchJobException e) {
catch (JobExecutionException e) {
log.error("Could not execute job.", e);
}
}