BATCH-339: ItemWriter#flush() now throws a FlushFailedException (unchecked) and ItemWriter#clear() now throws a ClearFailedException (also unchecked)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user