Browse Source

deprecated support for JMS 1.0.2 providers

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@674 50f2f4bb-b051-0410-bef5-90022cba6387
pull/1/head
Juergen Hoeller 17 years ago
parent
commit
1033015ffa
  1. 6
      org.springframework.jms/src/main/java/org/springframework/jms/connection/CachingConnectionFactory.java
  2. 4
      org.springframework.jms/src/main/java/org/springframework/jms/connection/JmsTransactionManager.java
  3. 4
      org.springframework.jms/src/main/java/org/springframework/jms/connection/JmsTransactionManager102.java
  4. 6
      org.springframework.jms/src/main/java/org/springframework/jms/connection/SingleConnectionFactory.java
  5. 4
      org.springframework.jms/src/main/java/org/springframework/jms/connection/SingleConnectionFactory102.java
  6. 55
      org.springframework.jms/src/main/java/org/springframework/jms/core/JmsTemplate.java
  7. 4
      org.springframework.jms/src/main/java/org/springframework/jms/core/JmsTemplate102.java
  8. 17
      org.springframework.jms/src/main/java/org/springframework/jms/core/support/JmsGatewaySupport.java
  9. 2
      org.springframework.jms/src/main/java/org/springframework/jms/core/support/package.html
  10. 4
      org.springframework.jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer.java
  11. 8
      org.springframework.jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer102.java
  12. 4
      org.springframework.jms/src/main/java/org/springframework/jms/listener/SimpleMessageListenerContainer.java
  13. 4
      org.springframework.jms/src/main/java/org/springframework/jms/listener/SimpleMessageListenerContainer102.java
  14. 5
      org.springframework.jms/src/main/java/org/springframework/jms/listener/adapter/MessageListenerAdapter.java
  15. 8
      org.springframework.jms/src/main/java/org/springframework/jms/listener/adapter/MessageListenerAdapter102.java
  16. 8
      org.springframework.jms/src/main/java/org/springframework/jms/support/converter/SimpleMessageConverter.java
  17. 4
      org.springframework.jms/src/main/java/org/springframework/jms/support/converter/SimpleMessageConverter102.java
  18. 3
      org.springframework.jms/src/main/resources/org/springframework/jms/config/spring-jms-3.0.xsd

6
org.springframework.jms/src/main/java/org/springframework/jms/connection/CachingConnectionFactory.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2008 the original author or authors. * Copyright 2002-2009 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -201,7 +201,7 @@ public class CachingConnectionFactory extends SingleConnectionFactory {
* Checks for a cached Session for the given mode. * Checks for a cached Session for the given mode.
*/ */
protected Session getSession(Connection con, Integer mode) throws JMSException { protected Session getSession(Connection con, Integer mode) throws JMSException {
LinkedList<Session> sessionList = null; LinkedList<Session> sessionList;
synchronized (this.cachedSessions) { synchronized (this.cachedSessions) {
sessionList = this.cachedSessions.get(mode); sessionList = this.cachedSessions.get(mode);
if (sessionList == null) { if (sessionList == null) {
@ -429,7 +429,7 @@ public class CachingConnectionFactory extends SingleConnectionFactory {
/** /**
* Simple wrapper class around a Destination and other consumer attributes. * Simple wrapper class around a Destination and other consumer attributes.
* Used as the key when caching consumers. * Used as the cache key when caching MessageConsumer objects.
*/ */
private static class ConsumerCacheKey { private static class ConsumerCacheKey {

4
org.springframework.jms/src/main/java/org/springframework/jms/connection/JmsTransactionManager.java

@ -40,10 +40,6 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
* Connection/Session pair from the specified ConnectionFactory to the thread, * Connection/Session pair from the specified ConnectionFactory to the thread,
* potentially allowing for one thread-bound Session per ConnectionFactory. * potentially allowing for one thread-bound Session per ConnectionFactory.
* *
* <p><b>NOTE:</b> This class requires a JMS 1.1+ provider because it builds on
* the domain-independent API. <b>Use the {@link JmsTransactionManager102} subclass
* for a JMS 1.0.2 provider, e.g. when running on a J2EE 1.3 server.</b>
*
* <p>This local strategy is an alternative to executing JMS operations within * <p>This local strategy is an alternative to executing JMS operations within
* JTA transactions. Its advantage is that it is able to work in any environment, * JTA transactions. Its advantage is that it is able to work in any environment,
* for example a standalone application or a test suite, with any message broker * for example a standalone application or a test suite, with any message broker

4
org.springframework.jms/src/main/java/org/springframework/jms/connection/JmsTransactionManager102.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2007 the original author or authors. * Copyright 2002-2009 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -39,7 +39,9 @@ import javax.jms.TopicConnectionFactory;
* @since 1.1 * @since 1.1
* @see #setConnectionFactory * @see #setConnectionFactory
* @see #setPubSubDomain * @see #setPubSubDomain
* @deprecated as of Spring 3.0, in favor of the JMS 1.1 based {@link JmsTransactionManager}
*/ */
@Deprecated
public class JmsTransactionManager102 extends JmsTransactionManager { public class JmsTransactionManager102 extends JmsTransactionManager {
private boolean pubSubDomain = false; private boolean pubSubDomain = false;

6
org.springframework.jms/src/main/java/org/springframework/jms/connection/SingleConnectionFactory.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2008 the original author or authors. * Copyright 2002-2009 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,7 +22,6 @@ import java.lang.reflect.Method;
import java.lang.reflect.Proxy; import java.lang.reflect.Proxy;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.jms.Connection; import javax.jms.Connection;
import javax.jms.ConnectionFactory; import javax.jms.ConnectionFactory;
import javax.jms.ExceptionListener; import javax.jms.ExceptionListener;
@ -49,8 +48,7 @@ import org.springframework.util.Assert;
* *
* <p>You can either pass in a specific JMS Connection directly or let this * <p>You can either pass in a specific JMS Connection directly or let this
* factory lazily create a Connection via a given target ConnectionFactory. * factory lazily create a Connection via a given target ConnectionFactory.
* This factory generally works with JMS 1.1 as well as JMS 1.0.2; use * This factory generally works with JMS 1.1 as well as the JMS 1.0.2 API.
* {@link SingleConnectionFactory102} for strict JMS 1.0.2 only usage.
* *
* <p>Note that when using the JMS 1.0.2 API, this ConnectionFactory will switch * <p>Note that when using the JMS 1.0.2 API, this ConnectionFactory will switch
* into queue/topic mode according to the JMS API methods used at runtime: * into queue/topic mode according to the JMS API methods used at runtime:

4
org.springframework.jms/src/main/java/org/springframework/jms/connection/SingleConnectionFactory102.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2007 the original author or authors. * Copyright 2002-2009 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -36,7 +36,9 @@ import javax.jms.TopicConnectionFactory;
* @since 1.1 * @since 1.1
* @see #setTargetConnectionFactory * @see #setTargetConnectionFactory
* @see #setPubSubDomain * @see #setPubSubDomain
* @deprecated as of Spring 3.0, in favor of the JMS 1.1 based {@link SingleConnectionFactory}
*/ */
@Deprecated
public class SingleConnectionFactory102 extends SingleConnectionFactory { public class SingleConnectionFactory102 extends SingleConnectionFactory {
private boolean pubSubDomain = false; private boolean pubSubDomain = false;

55
org.springframework.jms/src/main/java/org/springframework/jms/core/JmsTemplate.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2008 the original author or authors. * Copyright 2002-2009 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -41,14 +41,10 @@ import org.springframework.util.Assert;
/** /**
* Helper class that simplifies synchronous JMS access code. * Helper class that simplifies synchronous JMS access code.
* *
* <p><b>NOTE:</b> This class requires a JMS 1.1+ provider because it builds
* on the domain-independent API. <b>Use the {@link JmsTemplate102} subclass
* for a JMS 1.0.2 provider, e.g. when running on a J2EE 1.3 server.</b>
*
* <p>If you want to use dynamic destination creation, you must specify * <p>If you want to use dynamic destination creation, you must specify
* the type of JMS destination to create, using the "pubSubDomain" property. * the type of JMS destination to create, using the "pubSubDomain" property.
* For other operations, this is not necessary, in contrast to when working * For other operations, this is not necessary, in contrast to when working
* with JmsTemplate102. Point-to-Point (Queues) is the default domain. * with {@link JmsTemplate102}. Point-to-Point (Queues) is the default domain.
* *
* <p>Default settings for JMS Sessions are "not transacted" and "auto-acknowledge". * <p>Default settings for JMS Sessions are "not transacted" and "auto-acknowledge".
* As defined by the J2EE specification, the transaction and acknowledgement * As defined by the J2EE specification, the transaction and acknowledgement
@ -83,7 +79,6 @@ import org.springframework.util.Assert;
* @see #setPubSubDomain * @see #setPubSubDomain
* @see #setDestinationResolver * @see #setDestinationResolver
* @see #setMessageConverter * @see #setMessageConverter
* @see JmsTemplate102
* @see javax.jms.MessageProducer * @see javax.jms.MessageProducer
* @see javax.jms.MessageConsumer * @see javax.jms.MessageConsumer
*/ */
@ -536,7 +531,7 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations
} }
public void send(final Destination destination, final MessageCreator messageCreator) throws JmsException { public void send(final Destination destination, final MessageCreator messageCreator) throws JmsException {
execute(new SessionCallback() { execute(new SessionCallback<Object>() {
public Object doInJms(Session session) throws JMSException { public Object doInJms(Session session) throws JMSException {
doSend(session, destination, messageCreator); doSend(session, destination, messageCreator);
return null; return null;
@ -545,7 +540,7 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations
} }
public void send(final String destinationName, final MessageCreator messageCreator) throws JmsException { public void send(final String destinationName, final MessageCreator messageCreator) throws JmsException {
execute(new SessionCallback() { execute(new SessionCallback<Object>() {
public Object doInJms(Session session) throws JMSException { public Object doInJms(Session session) throws JMSException {
Destination destination = resolveDestinationName(session, destinationName); Destination destination = resolveDestinationName(session, destinationName);
doSend(session, destination, messageCreator); doSend(session, destination, messageCreator);
@ -697,16 +692,16 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations
} }
public Message receiveSelected(final Destination destination, final String messageSelector) throws JmsException { public Message receiveSelected(final Destination destination, final String messageSelector) throws JmsException {
return (Message) execute(new SessionCallback() { return execute(new SessionCallback<Message>() {
public Object doInJms(Session session) throws JMSException { public Message doInJms(Session session) throws JMSException {
return doReceive(session, destination, messageSelector); return doReceive(session, destination, messageSelector);
} }
}, true); }, true);
} }
public Message receiveSelected(final String destinationName, final String messageSelector) throws JmsException { public Message receiveSelected(final String destinationName, final String messageSelector) throws JmsException {
return (Message) execute(new SessionCallback() { return execute(new SessionCallback<Message>() {
public Object doInJms(Session session) throws JMSException { public Message doInJms(Session session) throws JMSException {
Destination destination = resolveDestinationName(session, destinationName); Destination destination = resolveDestinationName(session, destinationName);
return doReceive(session, destination, messageSelector); return doReceive(session, destination, messageSelector);
} }
@ -730,7 +725,7 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations
/** /**
* Actually receive a JMS message. * Actually receive a JMS message.
* @param session the JMS Session to operate on * @param session the JMS Session to operate on
* @param consumer the JMS MessageConsumer to send with * @param consumer the JMS MessageConsumer to receive with
* @return the JMS Message received, or <code>null</code> if none * @return the JMS Message received, or <code>null</code> if none
* @throws JMSException if thrown by JMS API methods * @throws JMSException if thrown by JMS API methods
*/ */
@ -743,18 +738,7 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations
if (resourceHolder != null && resourceHolder.hasTimeout()) { if (resourceHolder != null && resourceHolder.hasTimeout()) {
timeout = resourceHolder.getTimeToLiveInMillis(); timeout = resourceHolder.getTimeToLiveInMillis();
} }
Message message = doReceive(consumer, timeout);
Message message = null;
if (timeout == RECEIVE_TIMEOUT_NO_WAIT) {
message = consumer.receiveNoWait();
}
else if (timeout > 0) {
message = consumer.receive(timeout);
}
else {
message = consumer.receive();
}
if (session.getTransacted()) { if (session.getTransacted()) {
// Commit necessary - but avoid commit call within a JTA transaction. // Commit necessary - but avoid commit call within a JTA transaction.
if (isSessionLocallyTransacted(session)) { if (isSessionLocallyTransacted(session)) {
@ -775,6 +759,25 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations
} }
} }
/**
* Actually receive a message from the given consumer.
* @param consumer the JMS MessageConsumer to receive with
* @param timeout the receive timeout
* @return the JMS Message received, or <code>null</code> if none
* @throws JMSException if thrown by JMS API methods
*/
private Message doReceive(MessageConsumer consumer, long timeout) throws JMSException {
if (timeout == RECEIVE_TIMEOUT_NO_WAIT) {
return consumer.receiveNoWait();
}
else if (timeout > 0) {
return consumer.receive(timeout);
}
else {
return consumer.receive();
}
}
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// Convenience methods for receiving auto-converted messages // Convenience methods for receiving auto-converted messages

4
org.springframework.jms/src/main/java/org/springframework/jms/core/JmsTemplate102.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2008 the original author or authors. * Copyright 2002-2009 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -73,7 +73,9 @@ import org.springframework.jms.support.converter.SimpleMessageConverter102;
* @see javax.jms.TopicPublisher * @see javax.jms.TopicPublisher
* @see javax.jms.QueueReceiver * @see javax.jms.QueueReceiver
* @see javax.jms.TopicSubscriber * @see javax.jms.TopicSubscriber
* @deprecated as of Spring 3.0, in favor of the JMS 1.1 based {@link JmsTemplate}
*/ */
@Deprecated
public class JmsTemplate102 extends JmsTemplate { public class JmsTemplate102 extends JmsTemplate {
/** /**

17
org.springframework.jms/src/main/java/org/springframework/jms/core/support/JmsGatewaySupport.java

@ -1,12 +1,12 @@
/* /*
* Copyright 2002-2005 the original author or authors. * Copyright 2002-2009 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -31,8 +31,8 @@ import org.springframework.jms.core.JmsTemplate;
* <p>Requires a ConnectionFactory or a JmsTemplate instance to be set. * <p>Requires a ConnectionFactory or a JmsTemplate instance to be set.
* It will create its own JmsTemplate if a ConnectionFactory is passed in. * It will create its own JmsTemplate if a ConnectionFactory is passed in.
* A custom JmsTemplate instance can be created for a given ConnectionFactory * A custom JmsTemplate instance can be created for a given ConnectionFactory
* through overriding the <code>createJmsTemplate</code> method. * through overriding the {@link #createJmsTemplate} method.
* *
* @author Mark Pollack * @author Mark Pollack
* @since 1.1.1 * @since 1.1.1
* @see #setConnectionFactory * @see #setConnectionFactory
@ -42,6 +42,7 @@ import org.springframework.jms.core.JmsTemplate;
*/ */
public abstract class JmsGatewaySupport implements InitializingBean { public abstract class JmsGatewaySupport implements InitializingBean {
/** Logger available to subclasses */
protected final Log logger = LogFactory.getLog(getClass()); protected final Log logger = LogFactory.getLog(getClass());
private JmsTemplate jmsTemplate; private JmsTemplate jmsTemplate;
@ -92,12 +93,12 @@ public abstract class JmsGatewaySupport implements InitializingBean {
* Return the JmsTemplate for the gateway. * Return the JmsTemplate for the gateway.
*/ */
public final JmsTemplate getJmsTemplate() { public final JmsTemplate getJmsTemplate() {
return jmsTemplate; return this.jmsTemplate;
} }
public final void afterPropertiesSet() throws IllegalArgumentException, BeanInitializationException { public final void afterPropertiesSet() throws IllegalArgumentException, BeanInitializationException {
if (this.jmsTemplate == null) { if (this.jmsTemplate == null) {
throw new IllegalArgumentException("connectionFactory or jmsTemplate is required"); throw new IllegalArgumentException("'connectionFactory' or 'jmsTemplate' is required");
} }
try { try {
initGateway(); initGateway();

2
org.springframework.jms/src/main/java/org/springframework/jms/core/support/package.html

@ -1,7 +1,7 @@
<html> <html>
<body> <body>
Classes supporting the org.springframework.jms.core package. Classes supporting the <code>org.springframework.jms.core</code> package.
Contains a base class for JmsTemplate usage. Contains a base class for JmsTemplate usage.
</body> </body>

4
org.springframework.jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer.java

@ -43,10 +43,6 @@ import org.springframework.util.ClassUtils;
* Designed to work in a native JMS environment as well as in a J2EE environment, * Designed to work in a native JMS environment as well as in a J2EE environment,
* with only minimal differences in configuration. * with only minimal differences in configuration.
* *
* <p><b>NOTE:</b> This class requires a JMS 1.1+ provider, because it builds on
* the domain-independent API. <b>Use the {@link DefaultMessageListenerContainer102}
* subclass for a JMS 1.0.2 provider, e.g. when running on a J2EE 1.3 server.</b>
*
* <p>This is a simple but nevertheless powerful form of message listener container. * <p>This is a simple but nevertheless powerful form of message listener container.
* On startup, it obtains a fixed number of JMS Sessions to invoke the listener, * On startup, it obtains a fixed number of JMS Sessions to invoke the listener,
* and optionally allows for dynamic adaptation at runtime (up until a maximum number). * and optionally allows for dynamic adaptation at runtime (up until a maximum number).

8
org.springframework.jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer102.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2007 the original author or authors. * Copyright 2002-2009 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -41,7 +41,9 @@ import org.springframework.jms.connection.JmsResourceHolder;
* *
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 2.0 * @since 2.0
* @deprecated as of Spring 3.0, in favor of the JMS 1.1 based {@link DefaultMessageListenerContainer}
*/ */
@Deprecated
public class DefaultMessageListenerContainer102 extends DefaultMessageListenerContainer { public class DefaultMessageListenerContainer102 extends DefaultMessageListenerContainer {
/** /**
@ -49,7 +51,7 @@ public class DefaultMessageListenerContainer102 extends DefaultMessageListenerCo
* a QueueConnection or a TopicConnection, depending on the domain. * a QueueConnection or a TopicConnection, depending on the domain.
*/ */
protected Connection getConnection(JmsResourceHolder holder) { protected Connection getConnection(JmsResourceHolder holder) {
return holder.getConnection(isPubSubDomain() ? (Class) TopicConnection.class : QueueConnection.class); return holder.getConnection(isPubSubDomain() ? TopicConnection.class : QueueConnection.class);
} }
/** /**
@ -57,7 +59,7 @@ public class DefaultMessageListenerContainer102 extends DefaultMessageListenerCo
* a QueueSession or a TopicSession, depending on the domain. * a QueueSession or a TopicSession, depending on the domain.
*/ */
protected Session getSession(JmsResourceHolder holder) { protected Session getSession(JmsResourceHolder holder) {
return holder.getSession(isPubSubDomain() ? (Class) TopicSession.class : QueueSession.class); return holder.getSession(isPubSubDomain() ? TopicSession.class : QueueSession.class);
} }
/** /**

4
org.springframework.jms/src/main/java/org/springframework/jms/listener/SimpleMessageListenerContainer.java

@ -38,10 +38,6 @@ import org.springframework.util.Assert;
* <code>MessageConsumer.setMessageListener()</code> method to * <code>MessageConsumer.setMessageListener()</code> method to
* create concurrent MessageConsumers for the specified listeners. * create concurrent MessageConsumers for the specified listeners.
* *
* <p><b>NOTE:</b> This class requires a JMS 1.1+ provider, because it builds on
* the domain-independent API. <b>Use the {@link SimpleMessageListenerContainer102}
* subclass for a JMS 1.0.2 provider, e.g. when running on a J2EE 1.3 server.</b>
*
* <p>This is the simplest form of a message listener container. * <p>This is the simplest form of a message listener container.
* It creates a fixed number of JMS Sessions to invoke the listener, * It creates a fixed number of JMS Sessions to invoke the listener,
* not allowing for dynamic adaptation to runtime demands. Its main * not allowing for dynamic adaptation to runtime demands. Its main

4
org.springframework.jms/src/main/java/org/springframework/jms/listener/SimpleMessageListenerContainer102.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2007 the original author or authors. * Copyright 2002-2009 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -39,7 +39,9 @@ import javax.jms.TopicSession;
* *
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 2.0 * @since 2.0
* @deprecated as of Spring 3.0, in favor of the JMS 1.1 based {@link SimpleMessageListenerContainer}
*/ */
@Deprecated
public class SimpleMessageListenerContainer102 extends SimpleMessageListenerContainer { public class SimpleMessageListenerContainer102 extends SimpleMessageListenerContainer {
/** /**

5
org.springframework.jms/src/main/java/org/springframework/jms/listener/adapter/MessageListenerAdapter.java

@ -46,16 +46,11 @@ import org.springframework.util.ObjectUtils;
* Allows listener methods to operate on message content types, completely * Allows listener methods to operate on message content types, completely
* independent from the JMS API. * independent from the JMS API.
* *
* <p><b>NOTE:</b> This class requires a JMS 1.1+ provider, because it builds
* on the domain-independent API. <b>Use the {@link MessageListenerAdapter102
* MessageListenerAdapter102} subclass for JMS 1.0.2 providers.</b>
*
* <p>By default, the content of incoming JMS messages gets extracted before * <p>By default, the content of incoming JMS messages gets extracted before
* being passed into the target listener method, to let the target method * being passed into the target listener method, to let the target method
* operate on message content types such as String or byte array instead of * operate on message content types such as String or byte array instead of
* the raw {@link Message}. Message type conversion is delegated to a Spring * the raw {@link Message}. Message type conversion is delegated to a Spring
* JMS {@link MessageConverter}. By default, a {@link SimpleMessageConverter} * JMS {@link MessageConverter}. By default, a {@link SimpleMessageConverter}
* {@link org.springframework.jms.support.converter.SimpleMessageConverter102 (102)}
* will be used. (If you do not want such automatic message conversion taking * will be used. (If you do not want such automatic message conversion taking
* place, then be sure to set the {@link #setMessageConverter MessageConverter} * place, then be sure to set the {@link #setMessageConverter MessageConverter}
* to <code>null</code>.) * to <code>null</code>.)

8
org.springframework.jms/src/main/java/org/springframework/jms/listener/adapter/MessageListenerAdapter102.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2007 the original author or authors. * Copyright 2002-2009 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -41,18 +41,20 @@ import org.springframework.jms.support.converter.SimpleMessageConverter102;
* @author Juergen Hoeller * @author Juergen Hoeller
* @author Rick Evans * @author Rick Evans
* @since 2.0 * @since 2.0
* @deprecated as of Spring 3.0, in favor of the JMS 1.1 based {@link MessageListenerAdapter}
*/ */
@Deprecated
public class MessageListenerAdapter102 extends MessageListenerAdapter { public class MessageListenerAdapter102 extends MessageListenerAdapter {
/** /**
* Create a new instance of the {@link MessageListenerAdapter102} class * Create a new instance of the MessageListenerAdapter102 class
* with the default settings. * with the default settings.
*/ */
public MessageListenerAdapter102() { public MessageListenerAdapter102() {
} }
/** /**
* Create a new instance of the {@link MessageListenerAdapter102} class * Create a new instance of the MessageListenerAdapter102 class
* for the given delegate. * for the given delegate.
* @param delegate the target object to delegate message listening to * @param delegate the target object to delegate message listening to
*/ */

8
org.springframework.jms/src/main/java/org/springframework/jms/support/converter/SimpleMessageConverter.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2008 the original author or authors. * Copyright 2002-2009 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -40,12 +40,6 @@ import org.springframework.util.ObjectUtils;
* {@link javax.jms.BytesMessage}, a Map to a {@link javax.jms.MapMessage}, and * {@link javax.jms.BytesMessage}, a Map to a {@link javax.jms.MapMessage}, and
* a Serializable object to a {@link javax.jms.ObjectMessage} (or vice versa). * a Serializable object to a {@link javax.jms.ObjectMessage} (or vice versa).
* *
* <p>This converter implementation works for both JMS 1.1 and JMS 1.0.2,
* except when extracting a byte array from a BytesMessage. So for converting
* BytesMessages with a JMS 1.0.2 provider, use {@link SimpleMessageConverter102}.
* (As you would expect, {@link org.springframework.jms.core.JmsTemplate102}
* uses SimpleMessageConverter102 as default.)
*
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 1.1 * @since 1.1
* @see org.springframework.jms.core.JmsTemplate#convertAndSend * @see org.springframework.jms.core.JmsTemplate#convertAndSend

4
org.springframework.jms/src/main/java/org/springframework/jms/support/converter/SimpleMessageConverter102.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2007 the original author or authors. * Copyright 2002-2009 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -35,7 +35,9 @@ import javax.jms.JMSException;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 1.1.1 * @since 1.1.1
* @see javax.jms.BytesMessage#getBodyLength() * @see javax.jms.BytesMessage#getBodyLength()
* @deprecated as of Spring 3.0, in favor of the JMS 1.1 based {@link SimpleMessageConverter}
*/ */
@Deprecated
public class SimpleMessageConverter102 extends SimpleMessageConverter { public class SimpleMessageConverter102 extends SimpleMessageConverter {
public static final int BUFFER_SIZE = 4096; public static final int BUFFER_SIZE = 4096;

3
org.springframework.jms/src/main/resources/org/springframework/jms/config/spring-jms-3.0.xsd

@ -39,15 +39,12 @@
<xsd:documentation><![CDATA[ <xsd:documentation><![CDATA[
The type of this listener container: "default" or "simple", choosing The type of this listener container: "default" or "simple", choosing
between DefaultMessageListenerContainer and SimpleMessageListenerContainer. between DefaultMessageListenerContainer and SimpleMessageListenerContainer.
The "102" suffix adapts to a JMS provider that implements JMS 1.0.2 only.
]]></xsd:documentation> ]]></xsd:documentation>
</xsd:annotation> </xsd:annotation>
<xsd:simpleType> <xsd:simpleType>
<xsd:restriction base="xsd:NMTOKEN"> <xsd:restriction base="xsd:NMTOKEN">
<xsd:enumeration value="default"/> <xsd:enumeration value="default"/>
<xsd:enumeration value="default102"/>
<xsd:enumeration value="simple"/> <xsd:enumeration value="simple"/>
<xsd:enumeration value="simple102"/>
</xsd:restriction> </xsd:restriction>
</xsd:simpleType> </xsd:simpleType>
</xsd:attribute> </xsd:attribute>

Loading…
Cancel
Save