BATCH-339: ItemWriter#flush() now throws a FlushFailedException (unchecked) and ItemWriter#clear() now throws a ClearFailedException (also unchecked)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package org.springframework.batch.sample.dao;
|
||||
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.item.exception.ClearFailedException;
|
||||
import org.springframework.batch.item.exception.FlushFailedException;
|
||||
import org.springframework.batch.sample.domain.Game;
|
||||
import org.springframework.jdbc.core.support.JdbcDaoSupport;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -34,10 +36,10 @@ public class JdbcGameDao extends JdbcDaoSupport implements ItemWriter {
|
||||
this.getJdbcTemplate().update(INSERT_GAME, args);
|
||||
}
|
||||
|
||||
public void clear() throws Exception {
|
||||
public void clear() throws ClearFailedException {
|
||||
}
|
||||
|
||||
public void flush() throws Exception {
|
||||
public void flush() throws FlushFailedException {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package org.springframework.batch.sample.dao;
|
||||
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.item.exception.ClearFailedException;
|
||||
import org.springframework.batch.item.exception.FlushFailedException;
|
||||
import org.springframework.batch.sample.domain.PlayerSummary;
|
||||
import org.springframework.jdbc.core.support.JdbcDaoSupport;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -31,10 +33,10 @@ public class JdbcPlayerSummaryDao extends JdbcDaoSupport implements ItemWriter {
|
||||
public void close() throws Exception {
|
||||
}
|
||||
|
||||
public void clear() throws Exception {
|
||||
public void clear() throws ClearFailedException {
|
||||
}
|
||||
|
||||
public void flush() throws Exception {
|
||||
public void flush() throws FlushFailedException {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
package org.springframework.batch.sample.item.writer;
|
||||
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.item.exception.ClearFailedException;
|
||||
import org.springframework.batch.item.exception.FlushFailedException;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
@@ -30,10 +32,10 @@ public class DummyItemWriter implements ItemWriter {
|
||||
public void close() throws Exception {
|
||||
}
|
||||
|
||||
public void clear() throws Exception {
|
||||
public void clear() throws ClearFailedException {
|
||||
}
|
||||
|
||||
public void flush() throws Exception {
|
||||
public void flush() throws FlushFailedException {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import org.apache.commons.lang.SerializationUtils;
|
||||
import org.springframework.batch.execution.scope.StepContext;
|
||||
import org.springframework.batch.execution.scope.StepContextAware;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.item.exception.ClearFailedException;
|
||||
import org.springframework.batch.item.exception.FlushFailedException;
|
||||
import org.springframework.jdbc.core.support.JdbcDaoSupport;
|
||||
import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -76,10 +78,10 @@ public class StagingItemWriter extends JdbcDaoSupport implements
|
||||
public void close() throws Exception {
|
||||
}
|
||||
|
||||
public void clear() throws Exception {
|
||||
public void clear() throws ClearFailedException {
|
||||
}
|
||||
|
||||
public void flush() throws Exception {
|
||||
public void flush() throws FlushFailedException {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user