类 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
AnItemReader
for 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>
itemType
protected org.springframework.jms.core.JmsOperations
jmsTemplate
protected org.apache.commons.logging.Log
logger
构造器概要
构造器 构造器 说明 JmsItemReader()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
T
read()
Reads a piece of input data and advance to the next one.void
setItemType(java.lang.Class<? extends T> itemType)
Set the expected type of incoming message payloads.void
setJmsTemplate(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
- aJmsOperations
instance
setItemType
public void setItemType(java.lang.Class<? extends T> itemType)
Set the expected type of incoming message payloads. Set this toMessage
to 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()
从接口复制的说明:ItemReader
Reads a piece of input data and advance to the next one. Implementations must returnnull
at 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
null
if the data source is exhausted
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
- 指定者:
afterPropertiesSet
在接口中org.springframework.beans.factory.InitializingBean
- 抛出:
java.lang.Exception