From 949324c751625d661aafe2d97dd63205e75f2458 Mon Sep 17 00:00:00 2001 From: dsyer Date: Mon, 25 Feb 2008 17:37:03 +0000 Subject: [PATCH] Remove RepeatOperationsHolder (not necessary). --- .../execution/step/RepeatOperationsStep.java | 27 ++--------- .../step/support/RepeatOperationsHolder.java | 48 ------------------- .../support/RepeatOperationsStepTests.java | 22 --------- 3 files changed, 4 insertions(+), 93 deletions(-) delete mode 100644 spring-batch-execution/src/main/java/org/springframework/batch/execution/step/support/RepeatOperationsHolder.java diff --git a/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/RepeatOperationsStep.java b/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/RepeatOperationsStep.java index a360be615..d2166ec01 100644 --- a/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/RepeatOperationsStep.java +++ b/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/RepeatOperationsStep.java @@ -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). + *
* - * 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. * diff --git a/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/support/RepeatOperationsHolder.java b/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/support/RepeatOperationsHolder.java deleted file mode 100644 index 2193fa194..000000000 --- a/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/support/RepeatOperationsHolder.java +++ /dev/null @@ -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(); -} diff --git a/spring-batch-execution/src/test/java/org/springframework/batch/execution/step/support/RepeatOperationsStepTests.java b/spring-batch-execution/src/test/java/org/springframework/batch/execution/step/support/RepeatOperationsStepTests.java index 577fc7795..5e71fb89c 100644 --- a/spring-batch-execution/src/test/java/org/springframework/batch/execution/step/support/RepeatOperationsStepTests.java +++ b/spring-batch-execution/src/test/java/org/springframework/batch/execution/step/support/RepeatOperationsStepTests.java @@ -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();