本文整理汇总了Java中org.springframework.batch.item.ItemStream类的典型用法代码示例。如果您正苦于以下问题:Java ItemStream类的具体用法?Java ItemStream怎么用?Java ItemStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ItemStream类属于org.springframework.batch.item包,在下文中一共展示了ItemStream类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: read
import org.springframework.batch.item.ItemStream; //导入依赖的package包/类
@SuppressWarnings({"rawtypes", "unchecked"})
@Override
public T read() throws Exception, UnexpectedInputException, ParseException,
NonTransientResourceException {
T item;
//TODO Separate two steps and refactor
if(currentDelegate == null || (item = currentDelegate.read()) == null) {
logger.debug("Loading new item reader");
try {
if(currentDelegate != null && ItemStream.class.isAssignableFrom(currentDelegate.getClass())) {
((ItemStream) currentDelegate).close();
}
currentDelegate = delegates.remove(0);
logger.info("The current ItemReader is now " + currentDelegate);
if(currentDelegate != null && ItemStream.class.isAssignableFrom(currentDelegate.getClass())) {
((ItemStream) currentDelegate).open(new ExecutionContext());
}
} catch (IndexOutOfBoundsException e) {
//if there are no more delegates
logger.info("No more readers, returning null");
return null;
}
item = read();
}
//If targetType is null use the first delegate to define the expected type
if (targetType == null) {
targetType = (Class) item.getClass();
} else {
if(!targetType.isInstance(item)) {
logger.debug("Attempting to cast " + item + " to " + targetType);
item = (T) conversionService.convert(item, targetType);
}
}
logger.debug("Returning " + item);
return item;
}
开发者ID:RBGKew,项目名称:eMonocot,代码行数:37,代码来源:CompositeItemReader.java
示例2: open
import org.springframework.batch.item.ItemStream; //导入依赖的package包/类
/**
* 모든 Reader에 open을 호출함
*
* @throws ItemStreamException
*/
public void open(ExecutionContext executionContext)
throws ItemStreamException {
for (ItemStream itemStream : itemReaderList) {
itemStream.open(executionContext);
}
}
开发者ID:eGovFrame,项目名称:egovframework.rte.root,代码行数:12,代码来源:EgovCompositeFileReader.java
示例3: open
import org.springframework.batch.item.ItemStream; //导入依赖的package包/类
@Override
public void open(ExecutionContext sExecutionContext) throws ItemStreamException {
if (delegate instanceof ItemStream) {
((ItemStream) delegate).open(sExecutionContext);
}
}
开发者ID:acxio,项目名称:AGIA,代码行数:7,代码来源:MapAdaptorWriter.java
示例4: update
import org.springframework.batch.item.ItemStream; //导入依赖的package包/类
@Override
public void update(ExecutionContext sExecutionContext) throws ItemStreamException {
if (delegate instanceof ItemStream) {
((ItemStream) delegate).update(sExecutionContext);
}
}
开发者ID:acxio,项目名称:AGIA,代码行数:7,代码来源:MapAdaptorWriter.java
示例5: close
import org.springframework.batch.item.ItemStream; //导入依赖的package包/类
@Override
public void close() throws ItemStreamException {
if (delegate instanceof ItemStream) {
((ItemStream) delegate).close();
}
}
开发者ID:acxio,项目名称:AGIA,代码行数:7,代码来源:MapAdaptorWriter.java
示例6: open
import org.springframework.batch.item.ItemStream; //导入依赖的package包/类
@Override
public synchronized void open(ExecutionContext sExecutionContext) {
delegateExhausted = false;
((ItemStream) delegate).open(sExecutionContext);
}
开发者ID:acxio,项目名称:AGIA,代码行数:6,代码来源:MultiLineItemReader.java
示例7: update
import org.springframework.batch.item.ItemStream; //导入依赖的package包/类
@Override
public synchronized void update(ExecutionContext sExecutionContext) {
((ItemStream) delegate).update(sExecutionContext);
}
开发者ID:acxio,项目名称:AGIA,代码行数:5,代码来源:MultiLineItemReader.java
示例8: close
import org.springframework.batch.item.ItemStream; //导入依赖的package包/类
@Override
public synchronized void close() {
delegateExhausted = false;
((ItemStream) delegate).close();
}
开发者ID:acxio,项目名称:AGIA,代码行数:6,代码来源:MultiLineItemReader.java
示例9: setUp
import org.springframework.batch.item.ItemStream; //导入依赖的package包/类
@Before
public void setUp() {
((ItemStream) multiLineNodeListItemReader).open(new ExecutionContext());
}
开发者ID:acxio,项目名称:AGIA,代码行数:5,代码来源:MultiLineNodeListItemReaderTest.java
示例10: tearDown
import org.springframework.batch.item.ItemStream; //导入依赖的package包/类
@After
public void tearDown() {
((ItemStream) multiLineNodeListItemReader).close();
}
开发者ID:acxio,项目名称:AGIA,代码行数:5,代码来源:MultiLineNodeListItemReaderTest.java
示例11: close
import org.springframework.batch.item.ItemStream; //导入依赖的package包/类
@Override
public void close() throws ItemStreamException {
if (this.delegate instanceof ItemStream) {
((ItemStream)this.delegate).close();
}
}
开发者ID:riteshmahato,项目名称:SpringBatch--MultiThreaded,代码行数:7,代码来源:SynchronisedReader.java
示例12: open
import org.springframework.batch.item.ItemStream; //导入依赖的package包/类
@Override
public void open(ExecutionContext executionContext) throws ItemStreamException {
if (this.delegate instanceof ItemStream) {
((ItemStream)this.delegate).open(executionContext);
}
}
开发者ID:riteshmahato,项目名称:SpringBatch--MultiThreaded,代码行数:7,代码来源:SynchronisedReader.java
示例13: update
import org.springframework.batch.item.ItemStream; //导入依赖的package包/类
@Override
public void update(ExecutionContext executionContext) throws ItemStreamException {
if (this.delegate instanceof ItemStream) {
((ItemStream)this.delegate).update(executionContext);
}
}
开发者ID:riteshmahato,项目名称:SpringBatch--MultiThreaded,代码行数:7,代码来源:SynchronisedReader.java
示例14: setUp
import org.springframework.batch.item.ItemStream; //导入依赖的package包/类
@Before
public void setUp() {
((ItemStream) reader).open(new ExecutionContext());
}
开发者ID:debop,项目名称:spring-batch-experiments,代码行数:5,代码来源:ReaderWithListenerTest.java
示例15: tearDown
import org.springframework.batch.item.ItemStream; //导入依赖的package包/类
@After
public void tearDown() {
((ItemStream) reader).close();
}
开发者ID:debop,项目名称:spring-batch-experiments,代码行数:5,代码来源:ReaderWithListenerTest.java
示例16: update
import org.springframework.batch.item.ItemStream; //导入依赖的package包/类
/**
* 변경된 사항을 등록된 모든 Reader에 update함
*
* @see org.springframework.batch.item.ItemStream#update(ExecutionContext)
*/
public void update(ExecutionContext executionContext) {
for (ItemStream itemStream : itemReaderList) {
itemStream.update(executionContext);
}
}
开发者ID:eGovFrame,项目名称:egovframework.rte.root,代码行数:11,代码来源:EgovCompositeFileReader.java
示例17: close
import org.springframework.batch.item.ItemStream; //导入依赖的package包/类
/**
* 모든 Reader에 close를 호출함
*
* @throws ItemStreamException
*/
public void close() throws ItemStreamException {
for (ItemStream itemStream : itemReaderList) {
itemStream.close();
}
}
开发者ID:eGovFrame,项目名称:egovframework.rte.root,代码行数:11,代码来源:EgovCompositeFileReader.java
注:本文中的org.springframework.batch.item.ItemStream类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论