BATCH-220: Committed the read part of chunking, without adding it to the StepExecutor. It should be noted that I used 'Chunker' instead of 'ChunkReader', since there's already precedence in the java world, and it isn't reading chunk so much as making a chunk out of items. I have also added skipCount to StepExecution, since it's reasonable that this type of data A) should be persisted and B) the domain object is the most logical place for this type of state.

This commit is contained in:
lucasward
2008-02-11 03:18:09 +00:00
parent 7a2cdadf8c
commit f7cface009
8 changed files with 35 additions and 28 deletions

View File

@@ -17,21 +17,24 @@
package org.springframework.batch.io.exception;
/**
* This exception indicates an error which does not require the transaction to
* be rolled back (for example when an invalid record is skipped).
* This exception indicates an error encountered while reading. It should generally
* be thrown by classes that implement the {@link ItemReader} interface.
*
* @author Lucas Ward
*/
public class TransactionValidException extends BatchCriticalException {
public class ReadFailureException extends BatchCriticalException {
private static final long serialVersionUID = 4113323182216735223L;
public TransactionValidException(String msg, Throwable ex) {
public ReadFailureException(String msg, Throwable ex) {
super(msg, ex);
}
public TransactionValidException(String msg) {
public ReadFailureException(String msg) {
super(msg);
}
public TransactionValidException(Throwable nested) {
public ReadFailureException(Throwable nested) {
super(nested);
}
}

View File

@@ -20,7 +20,7 @@ package org.springframework.batch.io.exception;
/**
* This exception should be thrown when there are validation errors.
*/
public class ValidationException extends TransactionValidException {
public class ValidationException extends ReadFailureException {
private static final long serialVersionUID = 7926495144451758088L;
public ValidationException(String message) {

View File

@@ -17,20 +17,24 @@
package org.springframework.batch.io.exception;
/**
* Throwing this exception causes transaction rollback.
* Exception thrown after encountering an error during a write. It should
* generally be thrown by classes that implement the {@link ItemWriter}
* interface.
*
* @author Lucas Ward
*/
public class TransactionInvalidException extends BatchCriticalException {
public class WriteFailureException extends BatchCriticalException {
private static final long serialVersionUID = -1933213086873834098L;
public TransactionInvalidException(String msg, Throwable ex) {
public WriteFailureException(String msg, Throwable ex) {
super(msg, ex);
}
public TransactionInvalidException(String msg) {
public WriteFailureException(String msg) {
super(msg);
}
public TransactionInvalidException(Throwable nested) {
public WriteFailureException(Throwable nested) {
super(nested);
}
}

View File

@@ -21,7 +21,7 @@ import org.springframework.batch.item.exception.StreamException;
import org.springframework.transaction.TransactionStatus;
/**
* Generalised stream management broadcast strategy. Clients register
* Generalized stream management broadcast strategy. Clients register
* {@link ItemStream} instances under a well-known key, and then when they ask
* for {@link ItemStream} operations by that key, we call each one in turn that
* is registered under the key.

View File

@@ -19,7 +19,7 @@ package org.springframework.batch.repeat.exception.handler;
import java.util.HashMap;
import org.springframework.batch.common.ExceptionClassifierSupport;
import org.springframework.batch.io.exception.TransactionInvalidException;
import org.springframework.batch.io.exception.WriteFailureException;
import org.springframework.batch.repeat.RepeatContext;
/**
@@ -33,13 +33,13 @@ public class SimpleLimitExceptionHandler implements ExceptionHandler {
/**
* Name of exception classifier key for the
* {@link TransactionInvalidException}.
* {@link WriteFailureException}.
*/
private static final String TX_INVALID = "TX_INVALID";
private RethrowOnThresholdExceptionHandler delegate = new RethrowOnThresholdExceptionHandler();
private Class type = TransactionInvalidException.class;
private Class type = WriteFailureException.class;
/**
* Flag to indicate the the exception counters should be shared between
@@ -102,7 +102,7 @@ public class SimpleLimitExceptionHandler implements ExceptionHandler {
/**
* Setter for the Throwable type that this handler counts. Defaults to
* {@link TransactionInvalidException}.
* {@link WriteFailureException}.
*
* @param type
*/