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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user