BATCH-220: More refinements to chunking, both the chunker and dechunker now return a 'result'. The chunker returns a ChunkingResult, and the Dechunker returns a DechunkingResult, allowing for the step to handle exceptions in a uniform way.
This commit is contained in:
@@ -27,16 +27,31 @@ import org.springframework.batch.item.ItemWriter;
|
||||
*/
|
||||
public class WriteFailureException extends BatchCriticalException {
|
||||
private static final long serialVersionUID = -1933213086873834098L;
|
||||
|
||||
private final Object item;
|
||||
|
||||
public WriteFailureException(String msg, Throwable ex) {
|
||||
public WriteFailureException(String msg, Throwable ex, Object item) {
|
||||
super(msg, ex);
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
public WriteFailureException(String msg) {
|
||||
super(msg);
|
||||
this(msg, null, null);
|
||||
}
|
||||
|
||||
public WriteFailureException(Throwable nested) {
|
||||
super(nested);
|
||||
this("", nested, null);
|
||||
}
|
||||
|
||||
public WriteFailureException(String msg, Object item){
|
||||
this(msg, null, item);
|
||||
}
|
||||
|
||||
public WriteFailureException(Throwable nested, Object item){
|
||||
this("", nested, item);
|
||||
}
|
||||
|
||||
public Object getItem() {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ import org.springframework.util.Assert;
|
||||
* essentially a thin wrapper for a map that allows for type safety on reads. It
|
||||
* also allows for dirty checking by setting a 'dirty' flag whenever any put is
|
||||
* called.
|
||||
*
|
||||
* @author Lucas Ward
|
||||
*/
|
||||
public class ExecutionAttributes {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user