From 2cced977eced69e03363ece859797f6d0c63b715 Mon Sep 17 00:00:00 2001 From: lucasward Date: Thu, 26 Nov 2009 05:45:53 +0000 Subject: [PATCH] BATCH-1343:Reverted previous change --- .../org/springframework/batch/core/launch/JobLauncher.java | 7 +++++-- .../batch/core/launch/support/SimpleJobLauncher.java | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/JobLauncher.java b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/JobLauncher.java index 2d967d7f5..59fdd3cbd 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/JobLauncher.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/JobLauncher.java @@ -17,9 +17,11 @@ 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, @@ -59,6 +61,7 @@ public interface JobLauncher { * @throws JobParametersInvalidException if the parameters are not valid for * this job */ - public JobExecution run(Job job, JobParameters jobParameters) throws JobExecutionException; + public JobExecution run(Job job, JobParameters jobParameters) throws JobExecutionAlreadyRunningException, + JobRestartException, JobInstanceAlreadyCompleteException, JobParametersInvalidException; } diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJobLauncher.java b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJobLauncher.java index 1f219849f..8f29f9cc6 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJobLauncher.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJobLauncher.java @@ -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,7 +81,8 @@ public class SimpleJobLauncher implements JobLauncher, InitializingBean { * @throws JobParametersInvalidException */ public JobExecution run(final Job job, final JobParameters jobParameters) - throws JobExecutionException { + throws JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException, + JobParametersInvalidException { Assert.notNull(job, "The Job must not be null."); Assert.notNull(jobParameters, "The JobParameters must not be null.");