From 3292ab3ae07a29b795dbdc1c6ebd3acba922080a Mon Sep 17 00:00:00 2001 From: lucasward Date: Tue, 26 Feb 2008 20:10:32 +0000 Subject: [PATCH] BATCH-339: ItemWriter#flush() now throws a FlushFailedException (unchecked) and ItemWriter#clear() now throws a ClearFailedException (also unchecked) --- .../batch/execution/configuration/StubItemWriter.java | 6 ++++-- .../batch/execution/launch/EmptyItemWriter.java | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/spring-batch-execution/src/test/java/org/springframework/batch/execution/configuration/StubItemWriter.java b/spring-batch-execution/src/test/java/org/springframework/batch/execution/configuration/StubItemWriter.java index 82eb884b3..64d28a2ca 100644 --- a/spring-batch-execution/src/test/java/org/springframework/batch/execution/configuration/StubItemWriter.java +++ b/spring-batch-execution/src/test/java/org/springframework/batch/execution/configuration/StubItemWriter.java @@ -17,15 +17,17 @@ package org.springframework.batch.execution.configuration; import org.springframework.batch.item.ItemWriter; +import org.springframework.batch.item.exception.ClearFailedException; +import org.springframework.batch.item.exception.FlushFailedException; public class StubItemWriter implements ItemWriter { - public void clear() throws Exception { + public void clear() throws ClearFailedException { // TODO Auto-generated method stub throw new UnsupportedOperationException(); } - public void flush() throws Exception { + public void flush() throws FlushFailedException { // TODO Auto-generated method stub throw new UnsupportedOperationException(); } diff --git a/spring-batch-execution/src/test/java/org/springframework/batch/execution/launch/EmptyItemWriter.java b/spring-batch-execution/src/test/java/org/springframework/batch/execution/launch/EmptyItemWriter.java index 29fcc9ce9..cefc01d36 100644 --- a/spring-batch-execution/src/test/java/org/springframework/batch/execution/launch/EmptyItemWriter.java +++ b/spring-batch-execution/src/test/java/org/springframework/batch/execution/launch/EmptyItemWriter.java @@ -22,6 +22,8 @@ import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.batch.item.ItemWriter; +import org.springframework.batch.item.exception.ClearFailedException; +import org.springframework.batch.item.exception.FlushFailedException; import org.springframework.batch.support.transaction.TransactionAwareProxyFactory; import org.springframework.beans.factory.InitializingBean; @@ -62,11 +64,11 @@ public class EmptyItemWriter implements ItemWriter, InitializingBean { return list; } - public void clear() throws Exception { + public void clear() throws ClearFailedException { //no-op } - public void flush() throws Exception { + public void flush() throws FlushFailedException { //no-op }