org.springframework.integration.jms
Class JmsDestinationPollingSource

java.lang.Object
  extended by org.springframework.integration.jms.AbstractJmsTemplateBasedAdapter
      extended by org.springframework.integration.jms.JmsDestinationPollingSource
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, MessageSource<java.lang.Object>

public class JmsDestinationPollingSource
extends AbstractJmsTemplateBasedAdapter
implements MessageSource<java.lang.Object>

A source for receiving JMS Messages with a polling listener. This source is only recommended for very low message volume. Otherwise, the JmsMessageDrivenEndpoint that uses Spring's MessageListener container support is a better option.

Author:
Mark Fisher

Constructor Summary
JmsDestinationPollingSource(javax.jms.ConnectionFactory connectionFactory, javax.jms.Destination destination)
           
JmsDestinationPollingSource(javax.jms.ConnectionFactory connectionFactory, java.lang.String destinationName)
           
JmsDestinationPollingSource(org.springframework.jms.core.JmsTemplate jmsTemplate)
           
 
Method Summary
protected  void configureMessageConverter(org.springframework.jms.core.JmsTemplate jmsTemplate, JmsHeaderMapper headerMapper)
           
 Message<java.lang.Object> receive()
          Retrieve the next available message from this source.
 void setExtractPayload(boolean extractPayload)
          Specify whether the payload should be extracted from each received JMS Message to be used as the Spring Integration Message payload.
 
Methods inherited from class org.springframework.integration.jms.AbstractJmsTemplateBasedAdapter
afterPropertiesSet, getJmsTemplate, setConnectionFactory, setDestination, setDestinationName, setDestinationResolver, setHeaderMapper, setJmsTemplate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmsDestinationPollingSource

public JmsDestinationPollingSource(org.springframework.jms.core.JmsTemplate jmsTemplate)

JmsDestinationPollingSource

public JmsDestinationPollingSource(javax.jms.ConnectionFactory connectionFactory,
                                   javax.jms.Destination destination)

JmsDestinationPollingSource

public JmsDestinationPollingSource(javax.jms.ConnectionFactory connectionFactory,
                                   java.lang.String destinationName)
Method Detail

setExtractPayload

public void setExtractPayload(boolean extractPayload)
Specify whether the payload should be extracted from each received JMS Message to be used as the Spring Integration Message payload.

The default value is true. To force creation of Spring Integration Messages whose payload is the actual JMS Message, set this to false.


receive

public Message<java.lang.Object> receive()
Description copied from interface: MessageSource
Retrieve the next available message from this source. Returns null if no message is available.

Specified by:
receive in interface MessageSource<java.lang.Object>

configureMessageConverter

protected void configureMessageConverter(org.springframework.jms.core.JmsTemplate jmsTemplate,
                                         JmsHeaderMapper headerMapper)
Specified by:
configureMessageConverter in class AbstractJmsTemplateBasedAdapter