BATCH-339: ItemWriter#flush() now throws a FlushFailedException (unchecked) and ItemWriter#clear() now throws a ClearFailedException (also unchecked)

This commit is contained in:
lucasward
2008-02-26 20:10:32 +00:00
parent a7b05a1778
commit 3292ab3ae0
2 changed files with 8 additions and 4 deletions

View File

@@ -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();
}

View File

@@ -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
}