类 JmsItemReader<T>
- java.lang.Object
- org.springframework.batch.item.jms.JmsItemReader<T>
- 所有已实现的接口:
ItemReader<T>,org.springframework.beans.factory.InitializingBean
public class JmsItemReader<T> extends java.lang.Object implements ItemReader<T>, org.springframework.beans.factory.InitializingBean
AnItemReaderfor JMS using aJmsTemplate. The template should have a default destination, which will be used to provide items inread().
The implementation is thread-safe after its properties are set (normal singleton behavior).- 作者:
- Dave Syer
字段概要
字段 修饰符和类型 字段 说明 protected java.lang.Class<? extends T>itemTypeprotected org.springframework.jms.core.JmsOperationsjmsTemplateprotected org.apache.commons.logging.Loglogger
构造器概要
构造器 构造器 说明 JmsItemReader()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidafterPropertiesSet()Tread()Reads a piece of input data and advance to the next one.voidsetItemType(java.lang.Class<? extends T> itemType)Set the expected type of incoming message payloads.voidsetJmsTemplate(org.springframework.jms.core.JmsOperations jmsTemplate)Setter for JMS template.
字段详细资料
logger
protected org.apache.commons.logging.Log logger
jmsTemplate
protected org.springframework.jms.core.JmsOperations jmsTemplate
构造器详细资料
JmsItemReader
public JmsItemReader()
方法详细资料
setJmsTemplate
public void setJmsTemplate(org.springframework.jms.core.JmsOperations jmsTemplate)
Setter for JMS template.- 参数:
jmsTemplate- aJmsOperationsinstance
setItemType
public void setItemType(java.lang.Class<? extends T> itemType)
Set the expected type of incoming message payloads. Set this toMessageto receive the raw underlying message.- 参数:
itemType- the java class of the items to be delivered. Typically the same as the class parameter- 抛出:
java.lang.IllegalStateException- if the message payload is of the wrong type.
read
public T read()
从接口复制的说明:ItemReaderReads a piece of input data and advance to the next one. Implementations must returnnullat the end of the input data set. In a transactional setting, caller might get the same item twice from successive calls (or otherwise), if the first call was in a transaction that rolled back.- 指定者:
read在接口中ItemReader<T>- 返回:
- T the item to be processed or
nullif the data source is exhausted
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
- 指定者:
afterPropertiesSet在接口中org.springframework.beans.factory.InitializingBean- 抛出:
java.lang.Exception