Class JmsItemReaderBuilder<T>
- java.lang.Object
- org.springframework.batch.item.jms.builder.JmsItemReaderBuilder<T>
public class JmsItemReaderBuilder<T> extends java.lang.Object
Creates a fully qualified JmsItemReader.- Since:
- 4.0
- Author:
- Glenn Renfro
Field Summary
Fields Modifier and Type Field Description protected java.lang.Class<? extends T>
itemType
protected org.springframework.jms.core.JmsOperations
jmsTemplate
Constructor Summary
Constructors Constructor Description JmsItemReaderBuilder()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JmsItemReader<T>
build()
Returns a fully constructedJmsItemReader
.JmsItemReaderBuilder<T>
itemType(java.lang.Class<? extends T> itemType)
Set the expected type of incoming message payloads.JmsItemReaderBuilder<T>
jmsTemplate(org.springframework.jms.core.JmsOperations jmsTemplate)
Establish the JMS template that will be used by the JmsItemReader.
Field Detail
itemType
protected java.lang.Class<? extends T> itemType
jmsTemplate
protected org.springframework.jms.core.JmsOperations jmsTemplate
Method Detail
jmsTemplate
public JmsItemReaderBuilder<T> jmsTemplate(org.springframework.jms.core.JmsOperations jmsTemplate)
Establish the JMS template that will be used by the JmsItemReader.- Parameters:
jmsTemplate
- aJmsOperations
instance- Returns:
- this instance for method chaining.
- See Also:
JmsItemReader.setJmsTemplate(JmsOperations)
itemType
public JmsItemReaderBuilder<T> itemType(java.lang.Class<? extends T> itemType)
Set the expected type of incoming message payloads. Set this toMessage
to receive the raw underlying message.- Parameters:
itemType
- the java class of the items to be delivered. Typically the same as the class parameter- Returns:
- this instance for method chaining.
- Throws:
java.lang.IllegalStateException
- if the message payload is of the wrong type.- See Also:
JmsItemReader.setItemType(Class)
build
public JmsItemReader<T> build()
Returns a fully constructedJmsItemReader
.- Returns:
- a new
JmsItemReader