[BATCH-430] Removed the batch.io.exception package and moved classes to their approved locations

This commit is contained in:
nebhale
2008-03-07 14:18:49 +00:00
parent b2396b3ef4
commit 609ce9d347
94 changed files with 216 additions and 566 deletions

View File

@@ -21,6 +21,7 @@ import java.util.Iterator;
import java.util.List;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.InfrastructureException;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobExecutionException;
import org.springframework.batch.core.JobInstance;
@@ -30,7 +31,6 @@ import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.execution.listener.CompositeJobListener;
import org.springframework.batch.io.exception.InfrastructureException;
import org.springframework.batch.repeat.ExitStatus;
/**

View File

@@ -13,10 +13,10 @@ import org.apache.commons.lang.SerializationUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.InfrastructureException;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.io.exception.InfrastructureException;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.repeat.ExitStatus;
import org.springframework.beans.factory.InitializingBean;

View File

@@ -15,10 +15,10 @@
*/
package org.springframework.batch.execution.step;
import org.springframework.batch.core.InfrastructureException;
import org.springframework.batch.core.JobInterruptedException;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.io.exception.InfrastructureException;
/**
* A {@link Step} implementation that provides common behaviour to subclasses.

View File

@@ -20,6 +20,7 @@ import java.util.Date;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.InfrastructureException;
import org.springframework.batch.core.JobInstance;
import org.springframework.batch.core.JobInterruptedException;
import org.springframework.batch.core.StepContribution;
@@ -34,7 +35,6 @@ import org.springframework.batch.execution.step.support.SimpleExitStatusExceptio
import org.springframework.batch.execution.step.support.StepExecutionSynchronizer;
import org.springframework.batch.execution.step.support.StepInterruptionPolicy;
import org.springframework.batch.execution.step.support.ThreadStepInterruptionPolicy;
import org.springframework.batch.io.exception.InfrastructureException;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemStream;

View File

@@ -20,6 +20,7 @@ import java.util.Date;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.InfrastructureException;
import org.springframework.batch.core.JobInterruptedException;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepExecution;
@@ -27,7 +28,6 @@ import org.springframework.batch.core.StepListener;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.core.tasklet.Tasklet;
import org.springframework.batch.execution.listener.CompositeStepListener;
import org.springframework.batch.io.exception.InfrastructureException;
import org.springframework.batch.repeat.ExitStatus;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.InitializingBean;

View File

@@ -27,7 +27,7 @@ import org.springframework.batch.common.SubclassExceptionClassifier;
import org.springframework.batch.core.ItemSkipPolicy;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.io.exception.FlatFileParsingException;
import org.springframework.batch.item.file.FlatFileParseException;
/**
* <p>
@@ -35,14 +35,14 @@ import org.springframework.batch.io.exception.FlatFileParsingException;
* based upon how many items have been skipped. This is extremely useful
* behavior, as it allows you to skip records, but will throw a
* {@link SkipLimitExceededException} if a set limit has been exceeded. For
* example, it is generally advisable to skip {@link FlatFileParsingException}s,
* example, it is generally advisable to skip {@link FlatFileParseException}s,
* however, if the vast majority of records are causing exceptions, the file is
* likely bad.
* </p>
*
* <p>
* Furthermore, it is also likely that you only want to skip certain exceptions.
* {@link FlatFileParsingException} is a good example of an exception you will
* {@link FlatFileParseException} is a good example of an exception you will
* likely want to skip, but a {@link FileNotFoundException} should cause
* immediate termination of the {@link Step}. Because it would be impossible
* for a general purpose policy to determine all the types of exceptions that

View File

@@ -15,7 +15,7 @@
*/
package org.springframework.batch.execution.step.support;
import org.springframework.batch.io.exception.InfrastructureException;
import org.springframework.batch.core.InfrastructureException;
/**
* Exception indicating that the skip limit for a particular {@Step} has

View File

@@ -19,10 +19,10 @@ package org.springframework.batch.execution.job;
import java.util.ArrayList;
import java.util.List;
import org.springframework.batch.core.InfrastructureException;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.Step;
import org.springframework.batch.io.exception.InfrastructureException;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.util.ClassUtils;

View File

@@ -22,6 +22,7 @@ import java.util.List;
import junit.framework.TestCase;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.InfrastructureException;
import org.springframework.batch.core.ItemSkipPolicy;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobExecutionException;
@@ -41,7 +42,6 @@ import org.springframework.batch.execution.repository.dao.MapStepExecutionDao;
import org.springframework.batch.execution.repository.dao.StepExecutionDao;
import org.springframework.batch.execution.step.AbstractStep;
import org.springframework.batch.execution.step.support.NeverSkipItemSkipPolicy;
import org.springframework.batch.io.exception.InfrastructureException;
import org.springframework.batch.item.AbstractItemReader;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemWriter;

View File

@@ -23,6 +23,7 @@ import java.util.List;
import junit.framework.TestCase;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.InfrastructureException;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobInstance;
import org.springframework.batch.core.JobInterruptedException;
@@ -39,7 +40,6 @@ import org.springframework.batch.execution.repository.dao.MapStepExecutionDao;
import org.springframework.batch.execution.step.support.JobRepositorySupport;
import org.springframework.batch.execution.step.support.SimpleItemHandler;
import org.springframework.batch.execution.step.support.StepInterruptionPolicy;
import org.springframework.batch.io.exception.InfrastructureException;
import org.springframework.batch.item.AbstractItemReader;
import org.springframework.batch.item.AbstractItemWriter;
import org.springframework.batch.item.ExecutionContext;

View File

@@ -15,10 +15,10 @@
*/
package org.springframework.batch.execution.step;
import org.springframework.batch.core.InfrastructureException;
import org.springframework.batch.core.JobInterruptedException;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.io.exception.InfrastructureException;
import org.springframework.beans.factory.BeanNameAware;
/**

View File

@@ -6,6 +6,7 @@ import java.util.List;
import junit.framework.TestCase;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.InfrastructureException;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobInstance;
import org.springframework.batch.core.JobInterruptedException;
@@ -16,7 +17,6 @@ import org.springframework.batch.core.listener.StepListenerSupport;
import org.springframework.batch.core.tasklet.Tasklet;
import org.springframework.batch.execution.job.JobSupport;
import org.springframework.batch.execution.step.support.JobRepositorySupport;
import org.springframework.batch.io.exception.InfrastructureException;
import org.springframework.batch.repeat.ExitStatus;
public class TaskletStepTests extends TestCase {

View File

@@ -21,7 +21,7 @@ import java.util.List;
import junit.framework.TestCase;
import org.springframework.batch.io.exception.FlatFileParsingException;
import org.springframework.batch.item.file.FlatFileParseException;
/**
* @author Lucas Ward
@@ -35,14 +35,14 @@ public class SkipLimitReadFailurePolicyTests extends TestCase {
super.setUp();
List skippableExceptions = new ArrayList();
skippableExceptions.add(FlatFileParsingException.class);
skippableExceptions.add(FlatFileParseException.class);
failurePolicy = new LimitCheckingItemSkipPolicy(1, skippableExceptions);
}
public void testLimitExceed(){
try{
failurePolicy.shouldSkip(new FlatFileParsingException("", ""), 2);
failurePolicy.shouldSkip(new FlatFileParseException("", ""), 2);
fail();
}
catch(SkipLimitExceededException ex){
@@ -55,7 +55,7 @@ public class SkipLimitReadFailurePolicyTests extends TestCase {
}
public void testSkip(){
assertTrue(failurePolicy.shouldSkip(new FlatFileParsingException("",""), 0));
assertTrue(failurePolicy.shouldSkip(new FlatFileParseException("",""), 0));
}
}