RESOLVED - issue BATCH-362: Rename ExecutionAttributes to ExecutionContext
http://jira.springframework.org/browse/BATCH-362
This commit is contained in:
@@ -2,7 +2,7 @@ package org.springframework.batch.sample.item.reader;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.springframework.batch.item.ExecutionAttributes;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
import org.springframework.batch.item.ItemStream;
|
||||
import org.springframework.batch.item.exception.MarkFailedException;
|
||||
import org.springframework.batch.item.exception.ResetFailedException;
|
||||
@@ -94,16 +94,16 @@ public class GeneratingItemReader extends AbstractItemReaderRecoverer implements
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.batch.item.ItemStream#restoreFrom(org.springframework.batch.item.ExecutionAttributes)
|
||||
* @see org.springframework.batch.item.ItemStream#restoreFrom(org.springframework.batch.item.ExecutionContext)
|
||||
*/
|
||||
public void restoreFrom(ExecutionAttributes context) {
|
||||
public void restoreFrom(ExecutionContext context) {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.batch.item.ExecutionAttributesProvider#getExecutionAttributes()
|
||||
* @see org.springframework.batch.item.ExecutionContextProvider#getExecutionContext()
|
||||
*/
|
||||
public ExecutionAttributes getExecutionAttributes() {
|
||||
return new ExecutionAttributes();
|
||||
public ExecutionContext getExecutionContext() {
|
||||
return new ExecutionContext();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.batch.execution.scope.StepContext;
|
||||
import org.springframework.batch.execution.scope.StepContextAware;
|
||||
import org.springframework.batch.item.ExecutionAttributes;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
import org.springframework.batch.item.ItemStream;
|
||||
import org.springframework.batch.item.KeyedItemReader;
|
||||
import org.springframework.batch.item.exception.StreamException;
|
||||
@@ -212,7 +212,7 @@ public class StagingItemReader extends JdbcDaoSupport implements ItemStream, Key
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.springframework.batch.item.ItemStream#mark(org.springframework.batch.item.ExecutionAttributes)
|
||||
* @see org.springframework.batch.item.ItemStream#mark(org.springframework.batch.item.ExecutionContext)
|
||||
*/
|
||||
public void mark() {
|
||||
getBuffer().commit();
|
||||
@@ -221,7 +221,7 @@ public class StagingItemReader extends JdbcDaoSupport implements ItemStream, Key
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.springframework.batch.item.ItemStream#reset(org.springframework.batch.item.ExecutionAttributes)
|
||||
* @see org.springframework.batch.item.ItemStream#reset(org.springframework.batch.item.ExecutionContext)
|
||||
*/
|
||||
public void reset() {
|
||||
getBuffer().rollback();
|
||||
@@ -230,19 +230,19 @@ public class StagingItemReader extends JdbcDaoSupport implements ItemStream, Key
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.springframework.batch.item.ItemStream#restoreFrom(org.springframework.batch.item.ExecutionAttributes)
|
||||
* @see org.springframework.batch.item.ItemStream#restoreFrom(org.springframework.batch.item.ExecutionContext)
|
||||
*/
|
||||
public void restoreFrom(ExecutionAttributes context) {
|
||||
public void restoreFrom(ExecutionContext context) {
|
||||
// no-op
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.springframework.batch.item.ExecutionAttributesProvider#getExecutionAttributes()
|
||||
* @see org.springframework.batch.item.ExecutionContextProvider#getExecutionContext()
|
||||
*/
|
||||
public ExecutionAttributes getExecutionAttributes() {
|
||||
return new ExecutionAttributes();
|
||||
public ExecutionContext getExecutionContext() {
|
||||
return new ExecutionContext();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
package org.springframework.batch.sample.tasklet;
|
||||
|
||||
import org.springframework.batch.core.tasklet.Tasklet;
|
||||
import org.springframework.batch.item.ExecutionAttributes;
|
||||
import org.springframework.batch.item.ExecutionAttributesProvider;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
import org.springframework.batch.item.ExecutionContextProvider;
|
||||
import org.springframework.batch.repeat.ExitStatus;
|
||||
import org.springframework.batch.support.PropertiesConverter;
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.batch.support.PropertiesConverter;
|
||||
* @author Lucas Ward
|
||||
*
|
||||
*/
|
||||
public class InfiniteLoopTasklet implements Tasklet, ExecutionAttributesProvider {
|
||||
public class InfiniteLoopTasklet implements Tasklet, ExecutionContextProvider {
|
||||
|
||||
private int count = 0;
|
||||
|
||||
@@ -48,10 +48,10 @@ public class InfiniteLoopTasklet implements Tasklet, ExecutionAttributesProvider
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.batch.item.ExecutionAttributesProvider#getExecutionAttributes()
|
||||
* @see org.springframework.batch.item.ExecutionContextProvider#getExecutionContext()
|
||||
*/
|
||||
public ExecutionAttributes getExecutionAttributes() {
|
||||
return new ExecutionAttributes(PropertiesConverter.stringToProperties("count=" + count));
|
||||
public ExecutionContext getExecutionContext() {
|
||||
return new ExecutionContext(PropertiesConverter.stringToProperties("count=" + count));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
package org.springframework.batch.sample.tasklet;
|
||||
|
||||
import org.springframework.batch.core.tasklet.Tasklet;
|
||||
import org.springframework.batch.item.ExecutionAttributes;
|
||||
import org.springframework.batch.item.ExecutionAttributesProvider;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
import org.springframework.batch.item.ExecutionContextProvider;
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.batch.sample.dao.TradeDao;
|
||||
import org.springframework.batch.sample.domain.Trade;
|
||||
@@ -38,7 +38,7 @@ import org.springframework.util.Assert;
|
||||
* @author Lucas Ward
|
||||
* @author Dave Syer
|
||||
*/
|
||||
public class SimpleTradeWriter implements ItemWriter, ExecutionAttributesProvider {
|
||||
public class SimpleTradeWriter implements ItemWriter, ExecutionContextProvider {
|
||||
|
||||
/*
|
||||
* writes a Trade object to output
|
||||
@@ -67,10 +67,10 @@ public class SimpleTradeWriter implements ItemWriter, ExecutionAttributesProvide
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.batch.item.ExecutionAttributesProvider#getExecutionAttributes()
|
||||
* @see org.springframework.batch.item.ExecutionContextProvider#getExecutionContext()
|
||||
*/
|
||||
public ExecutionAttributes getExecutionAttributes() {
|
||||
ExecutionAttributes statistics = new ExecutionAttributes();
|
||||
public ExecutionContext getExecutionContext() {
|
||||
ExecutionContext statistics = new ExecutionContext();
|
||||
statistics.putLong("trade.count", tradeCount);
|
||||
return statistics;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user