RESOLVED - BATCH-913: Remove the JdkConcurrent* special classes

removed the redundant synchronizer factory, kept the synchronizer interface
This commit is contained in:
robokaso
2008-11-11 14:08:17 +00:00
parent 432bdfa3fe
commit 60ca279e80
3 changed files with 3 additions and 42 deletions

View File

@@ -25,7 +25,7 @@ import org.springframework.batch.core.StepExecution;
*
* @author Ben Hale
*/
class JdkConcurrentStepExecutionSynchronizer implements StepExecutionSynchronizer {
public class JdkConcurrentStepExecutionSynchronizer implements StepExecutionSynchronizer {
private final Semaphore semaphore = new Semaphore(1);

View File

@@ -1,37 +0,0 @@
/*
* Copyright 2002-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.core.step;
/**
* A factory for {@link StepExecutionSynchronizer} which simply creates one from
* java.util.concurrent components.
*
* @author Ben Hale
* @author Dave Syer
*/
public class StepExecutionSynchronizerFactory {
private final StepExecutionSynchronizer synchronizer;
public StepExecutionSynchronizerFactory() {
synchronizer = new JdkConcurrentStepExecutionSynchronizer();
}
public StepExecutionSynchronizer getStepExecutionSynchronizer() {
return synchronizer;
}
}

View File

@@ -26,8 +26,8 @@ import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.core.scope.StepContext;
import org.springframework.batch.core.scope.StepContextRepeatCallback;
import org.springframework.batch.core.step.AbstractStep;
import org.springframework.batch.core.step.JdkConcurrentStepExecutionSynchronizer;
import org.springframework.batch.core.step.StepExecutionSynchronizer;
import org.springframework.batch.core.step.StepExecutionSynchronizerFactory;
import org.springframework.batch.core.step.StepInterruptionPolicy;
import org.springframework.batch.core.step.ThreadStepInterruptionPolicy;
import org.springframework.batch.item.ExecutionContext;
@@ -86,7 +86,7 @@ public class TaskletStep extends AbstractStep {
private Tasklet tasklet;
private StepExecutionSynchronizer synchronizer;
private StepExecutionSynchronizer synchronizer = new JdkConcurrentStepExecutionSynchronizer();
/**
* Default constructor.
@@ -100,8 +100,6 @@ public class TaskletStep extends AbstractStep {
*/
public TaskletStep(String name) {
super(name);
synchronizer = new StepExecutionSynchronizerFactory()
.getStepExecutionSynchronizer();
}
/**