Remove RepeatOperationsHolder (not necessary).

This commit is contained in:
dsyer
2008-02-25 17:37:03 +00:00
parent b41415001a
commit 949324c751
3 changed files with 4 additions and 93 deletions

View File

@@ -19,36 +19,26 @@ package org.springframework.batch.execution.step;
import org.springframework.batch.core.domain.JobInterruptedException;
import org.springframework.batch.core.domain.Step;
import org.springframework.batch.core.domain.StepExecution;
import org.springframework.batch.execution.step.support.RepeatOperationsHolder;
import org.springframework.batch.io.exception.BatchCriticalException;
import org.springframework.batch.repeat.RepeatOperations;
/**
* {@link Step} implementation that allows full step of the
* A {@link Step} implementation that allows full configuration of the
* {@link RepeatOperations} that will be used in the chunk (inner loop).
* <br/>
*
* This class will likely not be necessary given current changes, however, it
* is calling super classes for compatibility.
* This class may be obsolete soon.
*
* @author Lucas Ward
* @author Dave Syer
* @author Ben Hale
*/
public class RepeatOperationsStep extends ItemOrientedStep implements RepeatOperationsHolder {
public class RepeatOperationsStep extends ItemOrientedStep {
private volatile RepeatOperations chunkOperations;
private volatile RepeatOperations stepOperations;
/**
* Public accessor for the chunkOperations property.
*
* @return the executor
*/
public RepeatOperations getChunkOperations() {
return chunkOperations;
}
/**
* Public setter for the chunkOperations.
*
@@ -58,15 +48,6 @@ public class RepeatOperationsStep extends ItemOrientedStep implements RepeatOper
this.chunkOperations = chunkOperations;
}
/**
* Public accessor for the stepOperations property.
*
* @return the stepOperations
*/
public RepeatOperations getStepOperations() {
return stepOperations;
}
/**
* Public setter for the {@link RepeatOperations} property.
*

View File

@@ -1,48 +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.support;
import org.springframework.batch.core.domain.Step;
import org.springframework.batch.repeat.RepeatOperations;
/**
* Marker interface for indicating that a {@link RepeatOperations} instance is
* available for the inner loop (chunk operations) and outer loop (step
* operations) in a {@link Step}. The inner loop is normally going to be
* in-process and thread-bound so it makes sense for {@link Step}
* implementations to be able to override the strategies that control that loop.
*
* @author Dave Syer
*
*/
public interface RepeatOperationsHolder {
/**
* Principal method in the {@link RepeatOperationsHolder} interface.
*
* @return a {@link RepeatOperations} which can be used to iterate over an
* inner loop (chunk).
*/
RepeatOperations getChunkOperations();
/**
* Additional method in the {@link RepeatOperationsHolder} interface.
*
* @return a {@link RepeatOperations} which can be used to iterate over an
* outer loop (step).
*/
RepeatOperations getStepOperations();
}

View File

@@ -52,29 +52,7 @@ public class RepeatOperationsStepTests extends TestCase {
repeatStep.setItemReader(new ItemReaderAdapter());
repeatStep.setItemWriter(new ItemWriterAdapter());
}
/**
* Test method for {@link org.springframework.batch.execution.step.RepeatOperationsStep#getChunkOperations()}.
*/
public void testSetChunkOperations() {
assertNull(repeatStep.getChunkOperations());
RepeatTemplate executor = new RepeatTemplate();
repeatStep.setChunkOperations(executor);
assertEquals(executor, repeatStep.getChunkOperations());
}
/**
* Test method for {@link org.springframework.batch.execution.step.RepeatOperationsStep#getChunkOperations()}.
*/
public void testSetStepOperations() {
assertNull(repeatStep.getChunkOperations());
RepeatTemplate executor = new RepeatTemplate();
repeatStep.setStepOperations(executor);
assertEquals(executor, repeatStep.getStepOperations());
}
public void testSuccessfulRepeatOperationsHolder() throws Exception {
RepeatTemplate repeatTemplate = new RepeatTemplate();
final List list = new ArrayList();