public class JmsItemReader<T> extends Object implements ItemReader<T>, org.springframework.beans.factory.InitializingBean
ItemReader
for JMS using a JmsTemplate
. The template
should have a default destination, which will be used to provide items in
read()
.Modifier and Type | Field and Description |
---|---|
protected Class<? extends T> |
itemType |
protected org.springframework.jms.core.JmsOperations |
jmsTemplate |
protected org.apache.commons.logging.Log |
logger |
Constructor and Description |
---|
JmsItemReader() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
T |
read()
Reads a piece of input data and advance to the next one.
|
void |
setItemType(Class<? extends T> itemType)
Set the expected type of incoming message payloads.
|
void |
setJmsTemplate(org.springframework.jms.core.JmsOperations jmsTemplate)
Setter for jms template.
|
protected org.apache.commons.logging.Log logger
protected org.springframework.jms.core.JmsOperations jmsTemplate
public void setJmsTemplate(org.springframework.jms.core.JmsOperations jmsTemplate)
jmsTemplate
- a JmsOperations
instancepublic void setItemType(Class<? extends T> itemType)
Message
to receive the raw underlying message.itemType
- the java class of the items to be delivered. Typically
the same as the class parameterIllegalStateException
- if the message payload is of the wrong
type.public T read()
ItemReader
null
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
in interface ItemReader<T>
Copyright © 2014 Pivotal. All rights reserved.