diff --git a/execution/src/main/java/org/springframework/batch/execution/job/DefaultJobExecutor.java b/execution/src/main/java/org/springframework/batch/execution/job/DefaultJobExecutor.java index b0b799c3b..6d88c677a 100644 --- a/execution/src/main/java/org/springframework/batch/execution/job/DefaultJobExecutor.java +++ b/execution/src/main/java/org/springframework/batch/execution/job/DefaultJobExecutor.java @@ -34,8 +34,8 @@ import org.springframework.batch.core.executor.StepExecutor; import org.springframework.batch.core.executor.StepExecutorFactory; import org.springframework.batch.core.executor.StepInterruptedException; import org.springframework.batch.core.repository.JobRepository; -import org.springframework.batch.execution.step.SimpleStepExecutorFactory; import org.springframework.batch.execution.step.simple.SimpleExitCodeExceptionClassifier; +import org.springframework.batch.execution.step.simple.SimpleStepExecutorFactory; import org.springframework.batch.io.exception.BatchCriticalException; import org.springframework.batch.repeat.ExitStatus; import org.springframework.batch.repeat.RepeatContext; diff --git a/execution/src/main/java/org/springframework/batch/execution/step/SimpleStepExecutorFactory.java b/execution/src/main/java/org/springframework/batch/execution/step/SimpleStepExecutorFactory.java deleted file mode 100644 index e33da04f2..000000000 --- a/execution/src/main/java/org/springframework/batch/execution/step/SimpleStepExecutorFactory.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2006-2007 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.batch.execution.step; - -import org.springframework.batch.core.configuration.StepConfiguration; -import org.springframework.batch.core.executor.StepExecutor; -import org.springframework.batch.core.executor.StepExecutorFactory; -import org.springframework.batch.core.repository.JobRepository; -import org.springframework.batch.execution.step.simple.SimpleStepExecutor; -import org.springframework.batch.repeat.RepeatOperations; -import org.springframework.batch.repeat.policy.SimpleCompletionPolicy; -import org.springframework.batch.repeat.support.RepeatTemplate; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.util.Assert; - -/** - * A {@link StepExecutorFactory} that only knows how to create - * {@link SimpleStepExecutor} instances. - * - * @author Dave Syer - * - */ -public class SimpleStepExecutorFactory implements StepExecutorFactory, InitializingBean { - - private JobRepository jobRepository; - - /** - * Create a {@link SimpleStepExecutor} for this configuration. If the - * configuration is a {@link SimpleStepConfiguration} then a - * {@link StepExecutor} is created with policies matching the commit - * interval of the configuration.
- * - * @throws IllegalStateException - * if the configuration is not a {@link SimpleStepConfiguration}. - * @throws IllegalStateException - * if the {@link JobRepository} is null. - * - * @see StepExecutorFactory#getExecutor(StepConfiguration) - */ - public StepExecutor getExecutor(StepConfiguration configuration) { - - Assert.notNull(jobRepository, "JobRepository cannot be null"); - Assert.state(configuration instanceof SimpleStepConfiguration, - "StepConfiguration must be instance of SimpleStepConfiguration - found: [" - + (configuration == null ? null : configuration - .getClass()) + "]"); - - SimpleStepExecutor executor = new SimpleStepExecutor(); - executor.setRepository(jobRepository); - RepeatTemplate template = new RepeatTemplate(); - RepeatOperations repeatOperations = template; - template.setCompletionPolicy(new SimpleCompletionPolicy( - ((SimpleStepConfiguration) configuration).getCommitInterval())); - - executor.setChunkOperations(repeatOperations); - - return executor; - - } - - /** - * Public setter for {@link JobRepository}. - * - * @param jobRepository is a mandatory dependence (no default). - */ - public void setJobRepository(JobRepository jobRepository) { - this.jobRepository = jobRepository; - } - - /** - * Assert that all mandatory properties are set (the {@link JobRepository}). - * - * @throws Exception - */ - public void afterPropertiesSet() throws Exception { - Assert.notNull(jobRepository); - } -} diff --git a/infrastructure/pom.xml b/infrastructure/pom.xml index 5ee64fe6b..a179b7b81 100644 --- a/infrastructure/pom.xml +++ b/infrastructure/pom.xml @@ -1,4 +1,6 @@ - + 4.0.0 spring-batch-infrastructure @@ -43,7 +45,6 @@ backport-util-concurrent backport-util-concurrent - 3.0 true @@ -100,20 +101,20 @@ true - org.springframework.ws + org.springframework.ws spring-oxm - 1.0.0 - true - - + 1.0.0 + true + + org.springframework spring-beans - - + + org.springframework spring-core - - + + org.hibernate @@ -147,7 +148,9 @@ org.apache.maven.plugins maven-clover-plugin - ${basedir}/src/test/resources/clover.license + + ${basedir}/src/test/resources/clover.license + diff --git a/samples/pom.xml b/samples/pom.xml index 1b11c1aaa..b1346fca7 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -146,6 +146,11 @@ cglib-nodep true + + backport-util-concurrent + backport-util-concurrent + true + org.apache.ibatis ibatis-sqlmap