Renamed JmsGateway to JmsInboundGateway (we also have JmsOutboundGateway now). The JmsSource is now JmsDestinationPollingSource.

This commit is contained in:
Mark Fisher
2008-10-17 19:55:03 +00:00
parent 8a62ae5ccb
commit 490b5970f5
6 changed files with 30 additions and 30 deletions

View File

@@ -27,22 +27,22 @@ import org.springframework.jms.core.JmsTemplate;
/**
* A source for receiving JMS Messages with a polling listener. This source is
* only recommended for very low message volume. Otherwise, the
* {@link JmsGateway} that uses Spring's MessageListener
* container support is highly recommended.
* {@link JmsInboundGateway} that uses Spring's MessageListener container
* support is a better option.
*
* @author Mark Fisher
*/
public class JmsSource extends AbstractJmsTemplateBasedAdapter implements MessageSource<Object> {
public class JmsDestinationPollingSource extends AbstractJmsTemplateBasedAdapter implements MessageSource<Object> {
public JmsSource(JmsTemplate jmsTemplate) {
public JmsDestinationPollingSource(JmsTemplate jmsTemplate) {
super(jmsTemplate);
}
public JmsSource(ConnectionFactory connectionFactory, Destination destination) {
public JmsDestinationPollingSource(ConnectionFactory connectionFactory, Destination destination) {
super(connectionFactory, destination);
}
public JmsSource(ConnectionFactory connectionFactory, String destinationName) {
public JmsDestinationPollingSource(ConnectionFactory connectionFactory, String destinationName) {
super(connectionFactory, destinationName);
}

View File

@@ -41,7 +41,7 @@ import org.springframework.util.Assert;
*
* @author Mark Fisher
*/
public class JmsGateway extends SimpleMessagingGateway implements Lifecycle, DisposableBean {
public class JmsInboundGateway extends SimpleMessagingGateway implements Lifecycle, DisposableBean {
private volatile AbstractMessageListenerContainer container;
@@ -146,7 +146,7 @@ public class JmsGateway extends SimpleMessagingGateway implements Lifecycle, Dis
listener.setDelegate(new SessionAwareMessageListener() {
public void onMessage(javax.jms.Message jmsMessage, Session session) throws JMSException {
Object object = messageConverter.fromMessage(jmsMessage);
Message<?> replyMessage = JmsGateway.this.sendAndReceiveMessage(object);
Message<?> replyMessage = JmsInboundGateway.this.sendAndReceiveMessage(object);
if (replyMessage != null) {
javax.jms.Message jmsReply = messageConverter.toMessage(replyMessage, session);
MessageProducer producer = session.createProducer(jmsMessage.getJMSReplyTo());

View File

@@ -23,7 +23,7 @@ import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.BeanDefinitionReaderUtils;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.integration.config.xml.AbstractPollingInboundChannelAdapterParser;
import org.springframework.integration.jms.JmsSource;
import org.springframework.integration.jms.JmsDestinationPollingSource;
import org.springframework.util.StringUtils;
/**
@@ -43,7 +43,7 @@ public class JmsInboundChannelAdapterParser extends AbstractPollingInboundChanne
@Override
protected String parseSource(Element element, ParserContext parserContext) {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(JmsSource.class);
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(JmsDestinationPollingSource.class);
String jmsTemplate = element.getAttribute(JmsAdapterParserUtils.JMS_TEMPLATE_ATTRIBUTE);
String destination = element.getAttribute(JmsAdapterParserUtils.DESTINATION_ATTRIBUTE);
String destinationName = element.getAttribute(JmsAdapterParserUtils.DESTINATION_NAME_ATTRIBUTE);

View File

@@ -25,7 +25,7 @@ import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.integration.config.xml.IntegrationNamespaceUtils;
import org.springframework.integration.jms.JmsGateway;
import org.springframework.integration.jms.JmsInboundGateway;
import org.springframework.util.StringUtils;
/**
@@ -33,11 +33,11 @@ import org.springframework.util.StringUtils;
*
* @author Mark Fisher
*/
public class JmsGatewayParser extends AbstractSingleBeanDefinitionParser {
public class JmsInboundGatewayParser extends AbstractSingleBeanDefinitionParser {
@Override
protected Class<?> getBeanClass(Element element) {
return JmsGateway.class;
return JmsInboundGateway.class;
}
@Override
@@ -56,7 +56,7 @@ public class JmsGatewayParser extends AbstractSingleBeanDefinitionParser {
String destinationName = element.getAttribute(JmsAdapterParserUtils.DESTINATION_NAME_ATTRIBUTE);
String messageConverter = element.getAttribute(JmsAdapterParserUtils.MESSAGE_CONVERTER_ATTRIBUTE);
if (StringUtils.hasText(element.getAttribute(JmsAdapterParserUtils.JMS_TEMPLATE_ATTRIBUTE))) {
throw new BeanCreationException(JmsGateway.class.getSimpleName() +
throw new BeanCreationException(JmsInboundGateway.class.getSimpleName() +
" does not accept a '" + JmsAdapterParserUtils.JMS_TEMPLATE_ATTRIBUTE +
"' reference. One of '" + JmsAdapterParserUtils.DESTINATION_ATTRIBUTE + "' or '" +
JmsAdapterParserUtils.DESTINATION_NAME_ATTRIBUTE + "' must be provided.");

View File

@@ -28,7 +28,7 @@ import org.springframework.integration.jms.JmsHeaders;
public class JmsNamespaceHandler extends NamespaceHandlerSupport {
public void init() {
this.registerBeanDefinitionParser("inbound-gateway", new JmsGatewayParser());
this.registerBeanDefinitionParser("inbound-gateway", new JmsInboundGatewayParser());
this.registerBeanDefinitionParser("inbound-channel-adapter", new JmsInboundChannelAdapterParser());
this.registerBeanDefinitionParser("outbound-channel-adapter", new JmsOutboundChannelAdapterParser());
this.registerBeanDefinitionParser("header-enricher", new SimpleHeaderEnricherParser(