diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/WriteFailureException.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/WriteFailureException.java index 93d6aefdb..5387c02f4 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/WriteFailureException.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/WriteFailureException.java @@ -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; } } diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ExecutionAttributes.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ExecutionAttributes.java index 80be0ebc5..17cc5548e 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ExecutionAttributes.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ExecutionAttributes.java @@ -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 {