OPEN - issue BATCH-429: Combine the core and execution modules

http://jira.springframework.org/browse/BATCH-429

Collapse step/support packages to remove cycle.
This commit is contained in:
dsyer
2008-03-09 09:43:45 +00:00
parent 70cedc7ea0
commit 94b067be39
39 changed files with 48 additions and 78 deletions

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.listener;
import org.springframework.batch.core.BatchListener;
import org.springframework.batch.core.ChunkListener;
@@ -21,10 +21,6 @@ import org.springframework.batch.core.ItemReadListener;
import org.springframework.batch.core.ItemWriteListener;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.StepListener;
import org.springframework.batch.core.listener.CompositeChunkListener;
import org.springframework.batch.core.listener.CompositeItemReadListener;
import org.springframework.batch.core.listener.CompositeItemWriteListener;
import org.springframework.batch.core.listener.CompositeStepListener;
import org.springframework.batch.item.ItemStream;
import org.springframework.batch.repeat.ExitStatus;
@@ -32,7 +28,7 @@ import org.springframework.batch.repeat.ExitStatus;
* @author Dave Syer
*
*/
public class ListenerMulticaster implements StepListener, ChunkListener, ItemReadListener,
public class MulticasterBatchListener implements StepListener, ChunkListener, ItemReadListener,
ItemWriteListener {
private CompositeStepListener stepListener = new CompositeStepListener();
@@ -46,13 +42,13 @@ public class ListenerMulticaster implements StepListener, ChunkListener, ItemRea
/**
* Initialise the listener instance.
*/
public ListenerMulticaster() {
public MulticasterBatchListener() {
super();
}
/**
* Register each of the objects as listeners. Once registered, calls to the
* {@link ListenerMulticaster} broadcast to the individual listeners.
* {@link MulticasterBatchListener} broadcast to the individual listeners.
*
* @param listeners an array of listener objects of types known to the
* multicaster.

View File

@@ -13,11 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.core.step.ItemOrientedStep;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemWriter;
import org.springframework.beans.factory.BeanNameAware;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import org.springframework.batch.core.ItemSkipPolicy;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import java.util.ArrayList;
import java.util.List;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import org.springframework.batch.core.StepExecution;

View File

@@ -13,13 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import org.springframework.batch.core.BatchListener;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepListener;
import org.springframework.batch.core.step.ItemHandler;
import org.springframework.batch.core.step.ItemOrientedStep;
import org.springframework.batch.core.listener.MulticasterBatchListener;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemStream;
import org.springframework.batch.item.ItemWriter;
@@ -47,7 +46,7 @@ public class DefaultStepFactoryBean extends AbstractStepFactoryBean {
private BatchListener[] listeners = new BatchListener[0];
private ListenerMulticaster listener = new ListenerMulticaster();
private MulticasterBatchListener listener = new MulticasterBatchListener();
private TaskExecutor taskExecutor;

View File

@@ -28,11 +28,6 @@ import org.springframework.batch.core.UnexpectedJobExecutionException;
import org.springframework.batch.core.listener.CompositeStepListener;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.core.runtime.ExitStatusExceptionClassifier;
import org.springframework.batch.core.step.support.DefaultStepExecutionSynchronizer;
import org.springframework.batch.core.step.support.SimpleExitStatusExceptionClassifier;
import org.springframework.batch.core.step.support.StepExecutionSynchronizer;
import org.springframework.batch.core.step.support.StepInterruptionPolicy;
import org.springframework.batch.core.step.support.ThreadStepInterruptionPolicy;
import org.springframework.batch.core.tasklet.Tasklet;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemStream;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import org.springframework.batch.core.ItemSkipPolicy;
import org.springframework.batch.core.StepContribution;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import java.io.FileNotFoundException;
import java.util.ArrayList;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import org.springframework.batch.core.ItemSkipPolicy;

View File

@@ -13,12 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import org.springframework.batch.core.BatchListener;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepListener;
import org.springframework.batch.core.step.ItemOrientedStep;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemStream;
import org.springframework.batch.item.ItemWriter;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import java.io.PrintWriter;
import java.io.StringWriter;

View File

@@ -13,10 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.step.ItemHandler;
import org.springframework.batch.item.ClearFailedException;
import org.springframework.batch.item.FlushFailedException;
import org.springframework.batch.item.ItemReader;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import org.springframework.batch.repeat.RepeatContext;
import org.springframework.batch.repeat.exception.ExceptionHandler;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import org.springframework.batch.core.UnexpectedJobExecutionException;

View File

@@ -13,11 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.step.ItemOrientedStep;
import org.springframework.batch.item.ItemKeyGenerator;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemRecoverer;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import org.springframework.batch.core.StepExecution;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import org.springframework.batch.core.JobInterruptedException;
import org.springframework.batch.core.Step;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

View File

@@ -1,7 +0,0 @@
<html>
<body>
<p>
Specific implementations of simple concerns.
</p>
</body>
</html>

View File

@@ -42,7 +42,7 @@ import org.springframework.batch.core.repository.support.dao.MapJobInstanceDao;
import org.springframework.batch.core.repository.support.dao.MapStepExecutionDao;
import org.springframework.batch.core.repository.support.dao.StepExecutionDao;
import org.springframework.batch.core.step.AbstractStep;
import org.springframework.batch.core.step.support.NeverSkipItemSkipPolicy;
import org.springframework.batch.core.step.NeverSkipItemSkipPolicy;
import org.springframework.batch.item.AbstractItemReader;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemWriter;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import java.util.ArrayList;
import java.util.Arrays;
@@ -34,8 +34,8 @@ import org.springframework.batch.core.repository.support.dao.MapJobExecutionDao;
import org.springframework.batch.core.repository.support.dao.MapJobInstanceDao;
import org.springframework.batch.core.repository.support.dao.MapStepExecutionDao;
import org.springframework.batch.core.step.AbstractStep;
import org.springframework.batch.core.step.DefaultStepFactoryBean;
import org.springframework.batch.core.step.ItemOrientedStep;
import org.springframework.batch.core.step.support.DefaultStepFactoryBean;
import org.springframework.batch.item.AbstractItemWriter;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemWriter;

View File

@@ -39,9 +39,6 @@ import org.springframework.batch.core.repository.support.dao.MapJobInstanceDao;
import org.springframework.batch.core.repository.support.dao.MapStepExecutionDao;
import org.springframework.batch.core.step.AbstractStep;
import org.springframework.batch.core.step.ItemOrientedStep;
import org.springframework.batch.core.step.support.JobRepositorySupport;
import org.springframework.batch.core.step.support.SimpleItemHandler;
import org.springframework.batch.core.step.support.StepInterruptionPolicy;
import org.springframework.batch.item.AbstractItemReader;
import org.springframework.batch.item.AbstractItemWriter;
import org.springframework.batch.item.ExecutionContext;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobExecution;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.MarkFailedException;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import java.util.ArrayList;
import java.util.List;
@@ -27,7 +27,7 @@ import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.job.JobSupport;
import org.springframework.batch.core.launch.EmptyItemWriter;
import org.springframework.batch.core.step.support.RepeatOperationsStepFactoryBean;
import org.springframework.batch.core.step.RepeatOperationsStepFactoryBean;
import org.springframework.batch.item.reader.ListItemReader;
import org.springframework.batch.repeat.ExitStatus;
import org.springframework.batch.repeat.RepeatCallback;

View File

@@ -13,14 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import org.springframework.batch.core.JobInterruptedException;
import org.springframework.batch.core.launch.support.ExitCodeMapper;
import org.springframework.batch.core.repository.NoSuchJobException;
import org.springframework.batch.core.runtime.ExitStatusExceptionClassifier;
import org.springframework.batch.core.step.support.SimpleExitStatusExceptionClassifier;
import org.springframework.batch.repeat.ExitStatus;
import junit.framework.TestCase;

View File

@@ -13,11 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import junit.framework.TestCase;
import org.springframework.batch.core.step.support.SimpleRetryExceptionHandler;
import org.springframework.batch.repeat.RepeatContext;
import org.springframework.batch.repeat.context.RepeatContextSupport;
import org.springframework.batch.repeat.exception.SimpleLimitExceptionHandler;
@@ -52,7 +51,7 @@ public class SimpleRetryExceptionHandlerTests extends TestCase {
/**
* Test method for
* {@link org.springframework.batch.core.step.support.SimpleRetryExceptionHandler#handleException(org.springframework.batch.repeat.RepeatContext, java.lang.Throwable)}.
* {@link org.springframework.batch.core.step.SimpleRetryExceptionHandler#handleException(org.springframework.batch.repeat.RepeatContext, java.lang.Throwable)}.
*/
public void testRethrowWhenRetryExhausted() {
@@ -77,7 +76,7 @@ public class SimpleRetryExceptionHandlerTests extends TestCase {
/**
* Test method for
* {@link org.springframework.batch.core.step.support.SimpleRetryExceptionHandler#handleException(org.springframework.batch.repeat.RepeatContext, java.lang.Throwable)}.
* {@link org.springframework.batch.core.step.SimpleRetryExceptionHandler#handleException(org.springframework.batch.repeat.RepeatContext, java.lang.Throwable)}.
*/
public void testNoRethrowWhenRetryNotExhausted() {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import java.io.FileNotFoundException;
import java.util.ArrayList;
@@ -21,8 +21,6 @@ import java.util.List;
import junit.framework.TestCase;
import org.springframework.batch.core.step.support.LimitCheckingItemSkipPolicy;
import org.springframework.batch.core.step.support.SkipLimitExceededException;
import org.springframework.batch.item.file.FlatFileParseException;
/**

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import java.util.ArrayList;
import java.util.Arrays;
@@ -33,7 +33,7 @@ import org.springframework.batch.core.repository.support.dao.MapJobExecutionDao;
import org.springframework.batch.core.repository.support.dao.MapJobInstanceDao;
import org.springframework.batch.core.repository.support.dao.MapStepExecutionDao;
import org.springframework.batch.core.step.ItemOrientedStep;
import org.springframework.batch.core.step.support.StatefulRetryStepFactoryBean;
import org.springframework.batch.core.step.StatefulRetryStepFactoryBean;
import org.springframework.batch.item.AbstractItemWriter;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemRecoverer;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import junit.framework.TestCase;
@@ -30,8 +30,7 @@ import org.springframework.batch.core.repository.support.dao.MapJobExecutionDao;
import org.springframework.batch.core.repository.support.dao.MapJobInstanceDao;
import org.springframework.batch.core.repository.support.dao.MapStepExecutionDao;
import org.springframework.batch.core.step.ItemOrientedStep;
import org.springframework.batch.core.step.support.SimpleItemHandler;
import org.springframework.batch.core.step.support.StepExecutionSynchronizer;
import org.springframework.batch.core.step.SimpleItemHandler;
import org.springframework.batch.item.AbstractItemReader;
import org.springframework.batch.item.AbstractItemWriter;
import org.springframework.batch.repeat.policy.SimpleCompletionPolicy;

View File

@@ -16,7 +16,6 @@ import org.springframework.batch.core.StepListener;
import org.springframework.batch.core.job.JobSupport;
import org.springframework.batch.core.listener.StepListenerSupport;
import org.springframework.batch.core.step.TaskletStep;
import org.springframework.batch.core.step.support.JobRepositorySupport;
import org.springframework.batch.core.tasklet.Tasklet;
import org.springframework.batch.repeat.ExitStatus;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.support;
package org.springframework.batch.core.step;
import junit.framework.TestCase;

View File

@@ -20,7 +20,7 @@
<bean id="test-job"
class="org.springframework.batch.core.job.JobSupport">
<property name="steps">
<bean id="step1" class="org.springframework.batch.core.step.support.DefaultStepFactoryBean">
<bean id="step1" class="org.springframework.batch.core.step.DefaultStepFactoryBean">
<property name="itemReader" ref="itemReader" />
<property name="itemWriter" ref="itemWriter" />
<property name="jobRepository" ref="jobRepository" />
@@ -38,7 +38,7 @@
class="org.springframework.batch.core.launch.EmptyItemWriter" />
<bean id="jobRepository"
class="org.springframework.batch.core.step.support.JobRepositorySupport" />
class="org.springframework.batch.core.step.JobRepositorySupport" />
<bean id="transactionManager"
class="org.springframework.batch.support.transaction.ResourcelessTransactionManager" />

View File

@@ -15,7 +15,7 @@
class="org.springframework.batch.core.job.JobSupport">
<property name="steps">
<bean id="step1"
class="org.springframework.batch.core.step.support.DefaultStepFactoryBean">
class="org.springframework.batch.core.step.DefaultStepFactoryBean">
<property name="itemReader">
<bean
class="org.springframework.batch.item.reader.ListItemReader">
@@ -28,7 +28,7 @@
</property>
<property name="jobRepository">
<bean
class="org.springframework.batch.core.step.support.JobRepositorySupport" />
class="org.springframework.batch.core.step.JobRepositorySupport" />
</property>
<property name="transactionManager">
<bean

View File

@@ -1,7 +1,7 @@
package org.springframework.batch.sample.step.support;
import org.springframework.batch.core.JobInterruptedException;
import org.springframework.batch.core.step.support.StepInterruptionPolicy;
import org.springframework.batch.core.step.StepInterruptionPolicy;
import org.springframework.batch.repeat.RepeatContext;
public class NoopStepInterruptionPolicy implements StepInterruptionPolicy {

View File

@@ -10,7 +10,7 @@
<bean id="retrySample" parent="simpleJob">
<property name="steps">
<bean id="step1" parent="simpleStep"
class="org.springframework.batch.core.step.support.StatefulRetryStepFactoryBean">
class="org.springframework.batch.core.step.StatefulRetryStepFactoryBean">
<property name="itemReader" ref="itemGenerator" />
<property name="itemWriter" ref="itemWriter" />
<property name="retryLimit" value="3" />

View File

@@ -58,7 +58,7 @@
<property name="allowStartIfComplete" value="true" />
</bean>
<bean id="simpleStep" class="org.springframework.batch.core.step.support.DefaultStepFactoryBean"
<bean id="simpleStep" class="org.springframework.batch.core.step.DefaultStepFactoryBean"
abstract="true">
<property name="transactionManager" ref="transactionManager" />
<property name="jobRepository" ref="jobRepository" />