Class JmsItemWriter<T>
- java.lang.Object
- org.springframework.batch.item.jms.JmsItemWriter<T>
- All Implemented Interfaces:
ItemWriter<T>
public class JmsItemWriter<T> extends java.lang.Object implements ItemWriter<T>
AnItemWriter
for JMS using aJmsTemplate
. The template should have a default destination, which will be used to send items inwrite(List)
.
The implementation is thread-safe after its properties are set (normal singleton behavior).- Author:
- Dave Syer
Field Summary
Fields Modifier and Type Field Description protected org.apache.commons.logging.Log
logger
Constructor Summary
Constructors Constructor Description JmsItemWriter()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setJmsTemplate(org.springframework.jms.core.JmsOperations jmsTemplate)
Setter for JMS template.void
write(java.util.List<? extends T> items)
Send the items one-by-one to the default destination of the JMS template.
Method Detail
setJmsTemplate
public void setJmsTemplate(org.springframework.jms.core.JmsOperations jmsTemplate)
Setter for JMS template.- Parameters:
jmsTemplate
- aJmsOperations
instance
write
public void write(java.util.List<? extends T> items) throws java.lang.Exception
Send the items one-by-one to the default destination of the JMS template.- Specified by:
write
in interfaceItemWriter<T>
- Parameters:
items
- items to be written- Throws:
java.lang.Exception
- if there are errors. The framework will catch the exception and convert or rethrow it as appropriate.- See Also:
ItemWriter.write(java.util.List)