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:38 +00:00
parent 3292ab3ae0
commit 93445b9164
4 changed files with 16 additions and 8 deletions

View File

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

View File

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

View File

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

View File

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