BATCH-1343:Changed JobLauncher signature to throws JobExecutionExecption, rather than individual exceptions

This commit is contained in:
lucasward
2009-11-26 05:27:34 +00:00
parent fc06eb4da2
commit d0ae07946e
2 changed files with 4 additions and 8 deletions

View File

@@ -17,11 +17,9 @@ package org.springframework.batch.core.launch;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobExecutionException;
import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.JobParametersInvalidException;
import org.springframework.batch.core.repository.JobExecutionAlreadyRunningException;
import org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException;
import org.springframework.batch.core.repository.JobRestartException;
/**
* Simple interface for controlling jobs, including possible ad-hoc executions,
@@ -61,7 +59,6 @@ public interface JobLauncher {
* @throws JobParametersInvalidException if the parameters are not valid for
* this job
*/
public JobExecution run(Job job, JobParameters jobParameters) throws JobExecutionAlreadyRunningException,
JobRestartException, JobInstanceAlreadyCompleteException, JobParametersInvalidException;
public JobExecution run(Job job, JobParameters jobParameters) throws JobExecutionException;
}

View File

@@ -21,11 +21,11 @@ import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobExecutionException;
import org.springframework.batch.core.JobInstance;
import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.JobParametersInvalidException;
import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.batch.core.repository.JobExecutionAlreadyRunningException;
import org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.core.repository.JobRestartException;
@@ -81,8 +81,7 @@ public class SimpleJobLauncher implements JobLauncher, InitializingBean {
* @throws JobParametersInvalidException
*/
public JobExecution run(final Job job, final JobParameters jobParameters)
throws JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException,
JobParametersInvalidException {
throws JobExecutionException {
Assert.notNull(job, "The Job must not be null.");
Assert.notNull(jobParameters, "The JobParameters must not be null.");