BATCH-365: ItemStream#Update and ItemStream#close now accept an ExecutionContext as an argument. I removed the local ExecutionContexts in the readers and readers, and had them use the passed in ones instead.

This commit is contained in:
lucasward
2008-02-26 21:23:08 +00:00
parent a582aa0229
commit 535fd28f91
6 changed files with 10 additions and 10 deletions

View File

@@ -66,7 +66,7 @@ public class FlatFileCustomerCreditWriter implements CustomerCreditDao,
public void close() throws Exception {
if (outputSource instanceof ItemStream) {
((ItemStream) outputSource).close();
((ItemStream) outputSource).close(null);
}
}

View File

@@ -61,7 +61,7 @@ public class GeneratingItemReader extends AbstractItemReaderRecoverer implements
/* (non-Javadoc)
* @see org.springframework.batch.item.ItemStream#close()
*/
public void close() throws StreamException {
public void close(ExecutionContext executionContext) throws StreamException {
// TODO Auto-generated method stub
}
@@ -89,7 +89,7 @@ public class GeneratingItemReader extends AbstractItemReaderRecoverer implements
/* (non-Javadoc)
* @see org.springframework.batch.item.ExecutionContextProvider#getExecutionContext()
*/
public void update() {
public void update(ExecutionContext executionContext) {
}
public void open(ExecutionContext context) throws StreamException {

View File

@@ -43,9 +43,9 @@ public class StagingItemReader extends JdbcDaoSupport implements ItemStream, Key
/**
*
* @see org.springframework.batch.io.driving.DrivingQueryItemReader#close()
* @see org.springframework.batch.io.driving.DrivingQueryItemReader#close(ExecutionContext)
*/
public void close() {
public void close(ExecutionContext executionContext) {
initialized = false;
keys = null;
if (TransactionSynchronizationManager.hasResource(BUFFER_KEY)) {
@@ -223,7 +223,7 @@ public class StagingItemReader extends JdbcDaoSupport implements ItemStream, Key
*
* @see org.springframework.batch.item.ExecutionContextProvider#getExecutionContext()
*/
public void update() {
public void update(ExecutionContext executionContext) {
}
}

View File

@@ -76,10 +76,10 @@ public class SimpleTradeWriter extends AbstractItemWriter implements ItemStream
/* (non-Javadoc)
* @see org.springframework.batch.item.ExecutionContextProvider#getExecutionContext()
*/
public void update() {
public void update(ExecutionContext executionContext) {
executionContext.putLong("trade.count", tradeCount);
}
public void close() throws StreamException {
public void close(ExecutionContext executionContext) throws StreamException {
}
}