From b4fcc457c5c679cb5ea454ad85fc71958cba553c Mon Sep 17 00:00:00 2001 From: dhgarrette Date: Tue, 3 Feb 2009 14:55:56 +0000 Subject: [PATCH] BATCH-1057: removed references to AbstractItemWriter --- docs/src/site/docbook/reference/appendix.xml | 18 +++--------------- .../site/docbook/reference/common-patterns.xml | 14 +++++++------- docs/src/site/docbook/reference/execution.xml | 12 ++++++------ 3 files changed, 16 insertions(+), 28 deletions(-) diff --git a/docs/src/site/docbook/reference/appendix.xml b/docs/src/site/docbook/reference/appendix.xml index 3b0d8a271..d6d5fc997 100644 --- a/docs/src/site/docbook/reference/appendix.xml +++ b/docs/src/site/docbook/reference/appendix.xml @@ -189,17 +189,6 @@ ItemWriter interfaces. - - AbstractItemWriter - - java.lang.Object - - Abstract base class of the - ItemWriter interface with default - implmentations of the flush and - clear methods. - - BatchSqlUpdateItemWriter @@ -262,7 +251,7 @@ This item writer is hibernate session aware and handles some transaction-related work that a non-"hibernate aware" item writer would not need to know about and then delegates - to another item writer to do the actual writing. + to another item writer to do the actual writing. @@ -273,8 +262,7 @@ This item writer is JPA EntityManager aware and handles some transaction-related work that a non-"jpa aware" ItemWriter would not need to know about and - then delegates to another writer to do the actual writing. - + then delegates to another writer to do the actual writing. @@ -291,4 +279,4 @@ - \ No newline at end of file + diff --git a/docs/src/site/docbook/reference/common-patterns.xml b/docs/src/site/docbook/reference/common-patterns.xml index 60a1f630b..c8e7d0ffd 100644 --- a/docs/src/site/docbook/reference/common-patterns.xml +++ b/docs/src/site/docbook/reference/common-patterns.xml @@ -80,9 +80,9 @@ isn't retried indefinitely or skipped), For example, a custom exception type could be used, as in the example below: - public class PoisonPillItemWriter extends AbstractItemWriter { + public class PoisonPillItemWriter implements ItemWriter<T> { - public void write(Object item) throws Exception { + public void write(T item) throws Exception { if (isPoisonPill(item)) { throw new PoisonPillException("Posion pill detected: "+item); @@ -178,7 +178,7 @@ accumulating state that should not be lost if the job aborts, the ItemStream interface should be implemented: - public class CustomItemWriter extends AbstractItemWriter implements + public class CustomItemWriter implements ItemWriter<Trade>, ItemStream, StepListener { @@ -205,10 +205,10 @@ executionContext.setDouble(TOTAL_AMOUNT_KEY, totalAmount); } - public void write(Object item) { + public void write(Trade item) { delegate.write(item); - totalAmount += ((Trade) item).getAmount(); + totalAmount += item.getAmount(); } @@ -314,7 +314,7 @@ how many lines there are, the ItemReader must be careful to always read an entire record. In order to do this, a custom ItemReader should be implemented as a wrapper for - the FlatFileItemReader. + the FlatFileItemReader. <bean id="itemReader" class="org.springframework.batch.sample.iosample.internal.MultiLineTradeItemReader"> @@ -400,7 +400,7 @@ within the batch job. Such a process could be kicked off separately by the scheduler, but the advantage of common meta-data about the run would be lost. Furthermore, a multi-step job would also need to be split up into - multiple jobs as well. + multiple jobs as well. Because the need is so common, Spring Batch provides a Tasklet implementation for calling system diff --git a/docs/src/site/docbook/reference/execution.xml b/docs/src/site/docbook/reference/execution.xml index b0469a99b..bd11d6102 100644 --- a/docs/src/site/docbook/reference/execution.xml +++ b/docs/src/site/docbook/reference/execution.xml @@ -1619,9 +1619,9 @@ isn't retried indefinitely or skipped), For example, a custom exception type could be used, as in the example below: - public class PoisonPillItemWriter extends AbstractItemWriter { + public class PoisonPillItemWriter implements ItemWriter<T> { - public void write(Object item) throws Exception { + public void write(T item) throws Exception { if (isPoisonPill(item)) { throw new PoisonPillException("Posion pill detected: "+item); @@ -1719,7 +1719,7 @@ ItemStream interface should be implemented: - public class CustomItemWriter extends AbstractItemWriter implements + public class CustomItemWriter implements ItemWriter<Trade> ItemStream, StepListener { @@ -1746,10 +1746,10 @@ executionContext.setDouble(TOTAL_AMOUNT_KEY, totalAmount); } - public void write(Object item) { + public void write(Trade item) { delegate.write(item); - totalAmount += ((Trade) item).getAmount(); + totalAmount += item.getAmount(); } @@ -1768,4 +1768,4 @@ itself. - \ No newline at end of file +