Jakarta EE 9 migration
Upgrades many dependency declarations; removes old EJB 2.x support and outdated Servlet-based integrations (Commons FileUpload, FreeMarker JSP support, Tiles). Closes gh-22093 Closes gh-25354 Closes gh-26185 Closes gh-27423 See gh-27424
This commit is contained in:
@@ -21,12 +21,12 @@ package org.springframework.jms;
|
||||
*
|
||||
* @author Mark Pollack
|
||||
* @since 1.1
|
||||
* @see javax.jms.IllegalStateException
|
||||
* @see jakarta.jms.IllegalStateException
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class IllegalStateException extends JmsException {
|
||||
|
||||
public IllegalStateException(javax.jms.IllegalStateException cause) {
|
||||
public IllegalStateException(jakarta.jms.IllegalStateException cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,12 @@ package org.springframework.jms;
|
||||
*
|
||||
* @author Mark Pollack
|
||||
* @since 1.1
|
||||
* @see javax.jms.InvalidClientIDException
|
||||
* @see jakarta.jms.InvalidClientIDException
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class InvalidClientIDException extends JmsException {
|
||||
|
||||
public InvalidClientIDException(javax.jms.InvalidClientIDException cause) {
|
||||
public InvalidClientIDException(jakarta.jms.InvalidClientIDException cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,12 @@ package org.springframework.jms;
|
||||
*
|
||||
* @author Mark Pollack
|
||||
* @since 1.1
|
||||
* @see javax.jms.InvalidDestinationException
|
||||
* @see jakarta.jms.InvalidDestinationException
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class InvalidDestinationException extends JmsException {
|
||||
|
||||
public InvalidDestinationException(javax.jms.InvalidDestinationException cause) {
|
||||
public InvalidDestinationException(jakarta.jms.InvalidDestinationException cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,12 @@ package org.springframework.jms;
|
||||
*
|
||||
* @author Mark Pollack
|
||||
* @since 1.1
|
||||
* @see javax.jms.InvalidSelectorException
|
||||
* @see jakarta.jms.InvalidSelectorException
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class InvalidSelectorException extends JmsException {
|
||||
|
||||
public InvalidSelectorException(javax.jms.InvalidSelectorException cause) {
|
||||
public InvalidSelectorException(jakarta.jms.InvalidSelectorException cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.jms;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import jakarta.jms.JMSException;
|
||||
|
||||
import org.springframework.core.NestedRuntimeException;
|
||||
import org.springframework.lang.Nullable;
|
||||
@@ -44,7 +44,7 @@ public abstract class JmsException extends NestedRuntimeException {
|
||||
* Constructor that takes a message and a root cause.
|
||||
* @param msg the detail message
|
||||
* @param cause the cause of the exception. This argument is generally
|
||||
* expected to be a proper subclass of {@link javax.jms.JMSException},
|
||||
* expected to be a proper subclass of {@link jakarta.jms.JMSException},
|
||||
* but can also be a JNDI NamingException or the like.
|
||||
*/
|
||||
public JmsException(String msg, @Nullable Throwable cause) {
|
||||
@@ -53,9 +53,9 @@ public abstract class JmsException extends NestedRuntimeException {
|
||||
|
||||
/**
|
||||
* Constructor that takes a plain root cause, intended for
|
||||
* subclasses mirroring corresponding {@code javax.jms} exceptions.
|
||||
* subclasses mirroring corresponding {@code jakarta.jms} exceptions.
|
||||
* @param cause the cause of the exception. This argument is generally
|
||||
* expected to be a proper subclass of {@link javax.jms.JMSException}.
|
||||
* expected to be a proper subclass of {@link jakarta.jms.JMSException}.
|
||||
*/
|
||||
public JmsException(@Nullable Throwable cause) {
|
||||
super(cause != null ? cause.getMessage() : null, cause);
|
||||
@@ -80,7 +80,7 @@ public abstract class JmsException extends NestedRuntimeException {
|
||||
/**
|
||||
* Return the detail message, including the message from the linked exception
|
||||
* if there is one.
|
||||
* @see javax.jms.JMSException#getLinkedException()
|
||||
* @see jakarta.jms.JMSException#getLinkedException()
|
||||
*/
|
||||
@Override
|
||||
@Nullable
|
||||
|
||||
@@ -21,12 +21,12 @@ package org.springframework.jms;
|
||||
*
|
||||
* @author Mark Pollack
|
||||
* @since 1.1
|
||||
* @see javax.jms.JMSSecurityException
|
||||
* @see jakarta.jms.JMSSecurityException
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class JmsSecurityException extends JmsException {
|
||||
|
||||
public JmsSecurityException(javax.jms.JMSSecurityException cause) {
|
||||
public JmsSecurityException(jakarta.jms.JMSSecurityException cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,12 @@ package org.springframework.jms;
|
||||
*
|
||||
* @author Mark Pollack
|
||||
* @since 1.1
|
||||
* @see javax.jms.MessageEOFException
|
||||
* @see jakarta.jms.MessageEOFException
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class MessageEOFException extends JmsException {
|
||||
|
||||
public MessageEOFException(javax.jms.MessageEOFException cause) {
|
||||
public MessageEOFException(jakarta.jms.MessageEOFException cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,12 @@ package org.springframework.jms;
|
||||
*
|
||||
* @author Mark Pollack
|
||||
* @since 1.1
|
||||
* @see javax.jms.MessageFormatException
|
||||
* @see jakarta.jms.MessageFormatException
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class MessageFormatException extends JmsException {
|
||||
|
||||
public MessageFormatException(javax.jms.MessageFormatException cause) {
|
||||
public MessageFormatException(jakarta.jms.MessageFormatException cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,12 @@ package org.springframework.jms;
|
||||
*
|
||||
* @author Mark Pollack
|
||||
* @since 1.1
|
||||
* @see javax.jms.MessageNotReadableException
|
||||
* @see jakarta.jms.MessageNotReadableException
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class MessageNotReadableException extends JmsException {
|
||||
|
||||
public MessageNotReadableException(javax.jms.MessageNotReadableException cause) {
|
||||
public MessageNotReadableException(jakarta.jms.MessageNotReadableException cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,12 @@ package org.springframework.jms;
|
||||
*
|
||||
* @author Mark Pollack
|
||||
* @since 1.1
|
||||
* @see javax.jms.MessageNotWriteableException
|
||||
* @see jakarta.jms.MessageNotWriteableException
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class MessageNotWriteableException extends JmsException {
|
||||
|
||||
public MessageNotWriteableException(javax.jms.MessageNotWriteableException cause) {
|
||||
public MessageNotWriteableException(jakarta.jms.MessageNotWriteableException cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,12 @@ package org.springframework.jms;
|
||||
*
|
||||
* @author Mark Pollack
|
||||
* @since 1.1
|
||||
* @see javax.jms.ResourceAllocationException
|
||||
* @see jakarta.jms.ResourceAllocationException
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ResourceAllocationException extends JmsException {
|
||||
|
||||
public ResourceAllocationException(javax.jms.ResourceAllocationException cause) {
|
||||
public ResourceAllocationException(jakarta.jms.ResourceAllocationException cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,12 @@ package org.springframework.jms;
|
||||
*
|
||||
* @author Mark Pollack
|
||||
* @since 1.1
|
||||
* @see javax.jms.TransactionInProgressException
|
||||
* @see jakarta.jms.TransactionInProgressException
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class TransactionInProgressException extends JmsException {
|
||||
|
||||
public TransactionInProgressException(javax.jms.TransactionInProgressException cause) {
|
||||
public TransactionInProgressException(jakarta.jms.TransactionInProgressException cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,12 @@ package org.springframework.jms;
|
||||
*
|
||||
* @author Mark Pollack
|
||||
* @since 1.1
|
||||
* @see javax.jms.TransactionRolledBackException
|
||||
* @see jakarta.jms.TransactionRolledBackException
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class TransactionRolledBackException extends JmsException {
|
||||
|
||||
public TransactionRolledBackException(javax.jms.TransactionRolledBackException cause) {
|
||||
public TransactionRolledBackException(jakarta.jms.TransactionRolledBackException cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class UncategorizedJmsException extends JmsException {
|
||||
* Constructor that takes a message and a root cause.
|
||||
* @param msg the detail message
|
||||
* @param cause the cause of the exception. This argument is generally
|
||||
* expected to be a proper subclass of {@link javax.jms.JMSException},
|
||||
* expected to be a proper subclass of {@link jakarta.jms.JMSException},
|
||||
* but can also be a JNDI NamingException or the like.
|
||||
*/
|
||||
public UncategorizedJmsException(String msg, Throwable cause) {
|
||||
@@ -47,7 +47,7 @@ public class UncategorizedJmsException extends JmsException {
|
||||
/**
|
||||
* Constructor that takes a root cause only.
|
||||
* @param cause the cause of the exception. This argument is generally
|
||||
* expected to be a proper subclass of {@link javax.jms.JMSException},
|
||||
* expected to be a proper subclass of {@link jakarta.jms.JMSException},
|
||||
* but can also be a JNDI NamingException or the like.
|
||||
*/
|
||||
public UncategorizedJmsException(Throwable cause) {
|
||||
|
||||
@@ -74,8 +74,8 @@ import org.springframework.context.annotation.Import;
|
||||
* is set a {@code JmsListenerContainerFactory} bean with name {@code jmsListenerContainerFactory} is
|
||||
* assumed to be present.
|
||||
*
|
||||
* <p>the following configuration would ensure that every time a {@link javax.jms.Message}
|
||||
* is received on the {@link javax.jms.Destination} named "myQueue", {@code MyService.process()}
|
||||
* <p>the following configuration would ensure that every time a {@link jakarta.jms.Message}
|
||||
* is received on the {@link jakarta.jms.Destination} named "myQueue", {@code MyService.process()}
|
||||
* is called with the content of the message:
|
||||
*
|
||||
* <pre class="code">
|
||||
|
||||
@@ -47,8 +47,8 @@ import org.springframework.messaging.handler.annotation.MessageMapping;
|
||||
* <p>Annotated JMS listener methods are allowed to have flexible signatures similar
|
||||
* to what {@link MessageMapping} provides:
|
||||
* <ul>
|
||||
* <li>{@link javax.jms.Session} to get access to the JMS session</li>
|
||||
* <li>{@link javax.jms.Message} or one of its subclasses to get access to the raw JMS message</li>
|
||||
* <li>{@link jakarta.jms.Session} to get access to the JMS session</li>
|
||||
* <li>{@link jakarta.jms.Message} or one of its subclasses to get access to the raw JMS message</li>
|
||||
* <li>{@link org.springframework.messaging.Message} to use Spring's messaging abstraction counterpart</li>
|
||||
* <li>{@link org.springframework.messaging.handler.annotation.Payload @Payload}-annotated method
|
||||
* arguments, including support for validation</li>
|
||||
|
||||
@@ -16,9 +16,8 @@
|
||||
|
||||
package org.springframework.jms.config;
|
||||
|
||||
import javax.jms.ConnectionFactory;
|
||||
import javax.jms.ExceptionListener;
|
||||
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
import jakarta.jms.ExceptionListener;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.jms.config;
|
||||
|
||||
import javax.jms.MessageListener;
|
||||
import jakarta.jms.MessageListener;
|
||||
|
||||
import org.springframework.jms.listener.AbstractMessageListenerContainer;
|
||||
import org.springframework.jms.listener.MessageListenerContainer;
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
|
||||
package org.springframework.jms.config;
|
||||
|
||||
import javax.jms.Session;
|
||||
|
||||
import jakarta.jms.Session;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.jms.config;
|
||||
|
||||
import javax.resource.spi.ResourceAdapter;
|
||||
import jakarta.resource.spi.ResourceAdapter;
|
||||
|
||||
import org.springframework.jms.listener.endpoint.JmsActivationSpecConfig;
|
||||
import org.springframework.jms.listener.endpoint.JmsActivationSpecFactory;
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
|
||||
package org.springframework.jms.config;
|
||||
|
||||
import javax.jms.Session;
|
||||
|
||||
import jakarta.jms.Session;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import org.springframework.beans.MutablePropertyValues;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.jms.config;
|
||||
|
||||
import javax.jms.MessageListener;
|
||||
import jakarta.jms.MessageListener;
|
||||
|
||||
import org.springframework.jms.listener.MessageListenerContainer;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
|
||||
package org.springframework.jms.connection;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.MessageConsumer;
|
||||
import javax.jms.MessageListener;
|
||||
import javax.jms.Queue;
|
||||
import javax.jms.QueueReceiver;
|
||||
import javax.jms.Topic;
|
||||
import javax.jms.TopicSubscriber;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.MessageConsumer;
|
||||
import jakarta.jms.MessageListener;
|
||||
import jakarta.jms.Queue;
|
||||
import jakarta.jms.QueueReceiver;
|
||||
import jakarta.jms.Topic;
|
||||
import jakarta.jms.TopicSubscriber;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
|
||||
@@ -16,15 +16,15 @@
|
||||
|
||||
package org.springframework.jms.connection;
|
||||
|
||||
import javax.jms.CompletionListener;
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.MessageProducer;
|
||||
import javax.jms.Queue;
|
||||
import javax.jms.QueueSender;
|
||||
import javax.jms.Topic;
|
||||
import javax.jms.TopicPublisher;
|
||||
import jakarta.jms.CompletionListener;
|
||||
import jakarta.jms.Destination;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.MessageProducer;
|
||||
import jakarta.jms.Queue;
|
||||
import jakarta.jms.QueueSender;
|
||||
import jakarta.jms.Topic;
|
||||
import jakarta.jms.TopicPublisher;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
|
||||
@@ -30,18 +30,18 @@ import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import javax.jms.ConnectionFactory;
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.MessageConsumer;
|
||||
import javax.jms.MessageProducer;
|
||||
import javax.jms.QueueSession;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.TemporaryQueue;
|
||||
import javax.jms.TemporaryTopic;
|
||||
import javax.jms.Topic;
|
||||
import javax.jms.TopicSession;
|
||||
import jakarta.jms.Connection;
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
import jakarta.jms.Destination;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.MessageConsumer;
|
||||
import jakarta.jms.MessageProducer;
|
||||
import jakarta.jms.QueueSession;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.TemporaryQueue;
|
||||
import jakarta.jms.TemporaryTopic;
|
||||
import jakarta.jms.Topic;
|
||||
import jakarta.jms.TopicSession;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -49,8 +49,8 @@ import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
* {@link SingleConnectionFactory} subclass that adds {@link javax.jms.Session}
|
||||
* caching as well {@link javax.jms.MessageProducer} caching. This ConnectionFactory
|
||||
* {@link SingleConnectionFactory} subclass that adds {@link jakarta.jms.Session}
|
||||
* caching as well {@link jakarta.jms.MessageProducer} caching. This ConnectionFactory
|
||||
* also switches the {@link #setReconnectOnException "reconnectOnException" property}
|
||||
* to "true" by default, allowing for automatic recovery of the underlying Connection.
|
||||
*
|
||||
|
||||
@@ -19,8 +19,8 @@ package org.springframework.jms.connection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.jms.ExceptionListener;
|
||||
import javax.jms.JMSException;
|
||||
import jakarta.jms.ExceptionListener;
|
||||
import jakarta.jms.JMSException;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
|
||||
@@ -16,17 +16,16 @@
|
||||
|
||||
package org.springframework.jms.connection;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import javax.jms.ConnectionFactory;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.QueueConnection;
|
||||
import javax.jms.QueueConnectionFactory;
|
||||
import javax.jms.QueueSession;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.TopicConnection;
|
||||
import javax.jms.TopicConnectionFactory;
|
||||
import javax.jms.TopicSession;
|
||||
|
||||
import jakarta.jms.Connection;
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.QueueConnection;
|
||||
import jakarta.jms.QueueConnectionFactory;
|
||||
import jakarta.jms.QueueSession;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.TopicConnection;
|
||||
import jakarta.jms.TopicConnectionFactory;
|
||||
import jakarta.jms.TopicSession;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
@@ -36,7 +35,7 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Helper class for managing a JMS {@link javax.jms.ConnectionFactory}, in particular
|
||||
* Helper class for managing a JMS {@link jakarta.jms.ConnectionFactory}, in particular
|
||||
* for obtaining transactional JMS resources for a given ConnectionFactory.
|
||||
*
|
||||
* <p>Mainly for internal use within the framework. Used by
|
||||
@@ -264,7 +263,7 @@ public abstract class ConnectionFactoryUtils {
|
||||
* JMS resources
|
||||
* @return the transactional Session, or {@code null} if none found
|
||||
* @throws JMSException in case of JMS failure
|
||||
* @see #doGetTransactionalSession(javax.jms.ConnectionFactory, ResourceFactory, boolean)
|
||||
* @see #doGetTransactionalSession(jakarta.jms.ConnectionFactory, ResourceFactory, boolean)
|
||||
*/
|
||||
@Nullable
|
||||
public static Session doGetTransactionalSession(
|
||||
|
||||
@@ -16,22 +16,22 @@
|
||||
|
||||
package org.springframework.jms.connection;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import javax.jms.ConnectionFactory;
|
||||
import javax.jms.JMSContext;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.QueueConnection;
|
||||
import javax.jms.QueueConnectionFactory;
|
||||
import javax.jms.TopicConnection;
|
||||
import javax.jms.TopicConnectionFactory;
|
||||
import jakarta.jms.Connection;
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
import jakarta.jms.JMSContext;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.QueueConnection;
|
||||
import jakarta.jms.QueueConnectionFactory;
|
||||
import jakarta.jms.TopicConnection;
|
||||
import jakarta.jms.TopicConnectionFactory;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* {@link javax.jms.ConnectionFactory} implementation that delegates all calls
|
||||
* to a given target {@link javax.jms.ConnectionFactory}, adapting specific
|
||||
* {@link jakarta.jms.ConnectionFactory} implementation that delegates all calls
|
||||
* to a given target {@link jakarta.jms.ConnectionFactory}, adapting specific
|
||||
* {@code create(Queue/Topic)Connection} calls to the target ConnectionFactory
|
||||
* if necessary (e.g. when running JMS 1.0.2 API based code against a generic
|
||||
* JMS 1.1 ConnectionFactory, such as ActiveMQ's PooledConnectionFactory).
|
||||
@@ -126,7 +126,7 @@ public class DelegatingConnectionFactory
|
||||
else {
|
||||
Connection con = target.createConnection();
|
||||
if (!(con instanceof QueueConnection)) {
|
||||
throw new javax.jms.IllegalStateException("'targetConnectionFactory' is not a QueueConnectionFactory");
|
||||
throw new jakarta.jms.IllegalStateException("'targetConnectionFactory' is not a QueueConnectionFactory");
|
||||
}
|
||||
return (QueueConnection) con;
|
||||
}
|
||||
@@ -141,7 +141,7 @@ public class DelegatingConnectionFactory
|
||||
else {
|
||||
Connection con = target.createConnection(username, password);
|
||||
if (!(con instanceof QueueConnection)) {
|
||||
throw new javax.jms.IllegalStateException("'targetConnectionFactory' is not a QueueConnectionFactory");
|
||||
throw new jakarta.jms.IllegalStateException("'targetConnectionFactory' is not a QueueConnectionFactory");
|
||||
}
|
||||
return (QueueConnection) con;
|
||||
}
|
||||
@@ -156,7 +156,7 @@ public class DelegatingConnectionFactory
|
||||
else {
|
||||
Connection con = target.createConnection();
|
||||
if (!(con instanceof TopicConnection)) {
|
||||
throw new javax.jms.IllegalStateException("'targetConnectionFactory' is not a TopicConnectionFactory");
|
||||
throw new jakarta.jms.IllegalStateException("'targetConnectionFactory' is not a TopicConnectionFactory");
|
||||
}
|
||||
return (TopicConnection) con;
|
||||
}
|
||||
@@ -171,7 +171,7 @@ public class DelegatingConnectionFactory
|
||||
else {
|
||||
Connection con = target.createConnection(username, password);
|
||||
if (!(con instanceof TopicConnection)) {
|
||||
throw new javax.jms.IllegalStateException("'targetConnectionFactory' is not a TopicConnectionFactory");
|
||||
throw new jakarta.jms.IllegalStateException("'targetConnectionFactory' is not a TopicConnectionFactory");
|
||||
}
|
||||
return (TopicConnection) con;
|
||||
}
|
||||
|
||||
@@ -22,12 +22,11 @@ import java.util.Deque;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import javax.jms.ConnectionFactory;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.TransactionInProgressException;
|
||||
|
||||
import jakarta.jms.Connection;
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.TransactionInProgressException;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
@@ -243,7 +242,7 @@ public class JmsResourceHolder extends ResourceHolderSupport {
|
||||
catch (TransactionInProgressException ex) {
|
||||
// Ignore -> can only happen in case of a JTA transaction.
|
||||
}
|
||||
catch (javax.jms.IllegalStateException ex) {
|
||||
catch (jakarta.jms.IllegalStateException ex) {
|
||||
if (this.connectionFactory != null) {
|
||||
try {
|
||||
Method getDataSourceMethod = this.connectionFactory.getClass().getMethod("getDataSource");
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
package org.springframework.jms.connection;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import javax.jms.ConnectionFactory;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.TransactionRolledBackException;
|
||||
import jakarta.jms.Connection;
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.TransactionRolledBackException;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.lang.Nullable;
|
||||
@@ -38,7 +38,7 @@ import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* {@link org.springframework.transaction.PlatformTransactionManager} implementation
|
||||
* for a single JMS {@link javax.jms.ConnectionFactory}. Binds a JMS
|
||||
* for a single JMS {@link jakarta.jms.ConnectionFactory}. Binds a JMS
|
||||
* Connection/Session pair from the specified ConnectionFactory to the thread,
|
||||
* potentially allowing for one thread-bound Session per ConnectionFactory.
|
||||
*
|
||||
@@ -52,12 +52,12 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* <p>Application code is required to retrieve the transactional JMS Session via
|
||||
* {@link ConnectionFactoryUtils#getTransactionalSession} instead of a standard
|
||||
* Java EE-style {@link ConnectionFactory#createConnection()} call with subsequent
|
||||
* Jakarta EE-style {@link ConnectionFactory#createConnection()} call with subsequent
|
||||
* Session creation. Spring's {@link org.springframework.jms.core.JmsTemplate}
|
||||
* will autodetect a thread-bound Session and automatically participate in it.
|
||||
*
|
||||
* <p>Alternatively, you can allow application code to work with the standard
|
||||
* Java EE-style lookup pattern on a ConnectionFactory, for example for legacy code
|
||||
* Jakarta EE-style lookup pattern on a ConnectionFactory, for example for legacy code
|
||||
* that is not aware of Spring at all. In that case, define a
|
||||
* {@link TransactionAwareConnectionFactoryProxy} for your target ConnectionFactory,
|
||||
* which will automatically participate in Spring-managed transactions.
|
||||
@@ -324,7 +324,7 @@ public class JmsTransactionManager extends AbstractPlatformTransactionManager
|
||||
* Create a JMS Connection via this template's ConnectionFactory.
|
||||
* <p>This implementation uses JMS 1.1 API.
|
||||
* @return the new JMS Connection
|
||||
* @throws javax.jms.JMSException if thrown by JMS API methods
|
||||
* @throws jakarta.jms.JMSException if thrown by JMS API methods
|
||||
*/
|
||||
protected Connection createConnection() throws JMSException {
|
||||
return obtainConnectionFactory().createConnection();
|
||||
@@ -335,7 +335,7 @@ public class JmsTransactionManager extends AbstractPlatformTransactionManager
|
||||
* <p>This implementation uses JMS 1.1 API.
|
||||
* @param con the JMS Connection to create a Session for
|
||||
* @return the new JMS Session
|
||||
* @throws javax.jms.JMSException if thrown by JMS API methods
|
||||
* @throws jakarta.jms.JMSException if thrown by JMS API methods
|
||||
*/
|
||||
protected Session createSession(Connection con) throws JMSException {
|
||||
return con.createSession(true, Session.AUTO_ACKNOWLEDGE);
|
||||
|
||||
@@ -16,17 +16,17 @@
|
||||
|
||||
package org.springframework.jms.connection;
|
||||
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
/**
|
||||
* Subinterface of {@link javax.jms.Session} to be implemented by
|
||||
* Subinterface of {@link jakarta.jms.Session} to be implemented by
|
||||
* Session proxies. Allows access to the underlying target Session.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 2.0.4
|
||||
* @see TransactionAwareConnectionFactoryProxy
|
||||
* @see CachingConnectionFactory
|
||||
* @see ConnectionFactoryUtils#getTargetSession(javax.jms.Session)
|
||||
* @see ConnectionFactoryUtils#getTargetSession(jakarta.jms.Session)
|
||||
*/
|
||||
public interface SessionProxy extends Session {
|
||||
|
||||
|
||||
@@ -25,17 +25,16 @@ import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import javax.jms.ConnectionFactory;
|
||||
import javax.jms.ExceptionListener;
|
||||
import javax.jms.JMSContext;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.QueueConnection;
|
||||
import javax.jms.QueueConnectionFactory;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.TopicConnection;
|
||||
import javax.jms.TopicConnectionFactory;
|
||||
|
||||
import jakarta.jms.Connection;
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
import jakarta.jms.ExceptionListener;
|
||||
import jakarta.jms.JMSContext;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.QueueConnection;
|
||||
import jakarta.jms.QueueConnectionFactory;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.TopicConnection;
|
||||
import jakarta.jms.TopicConnectionFactory;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
@@ -49,7 +48,7 @@ import org.springframework.util.ObjectUtils;
|
||||
/**
|
||||
* A JMS ConnectionFactory adapter that returns the same Connection
|
||||
* from all {@link #createConnection()} calls, and ignores calls to
|
||||
* {@link javax.jms.Connection#close()}. According to the JMS Connection
|
||||
* {@link jakarta.jms.Connection#close()}. According to the JMS Connection
|
||||
* model, this is perfectly thread-safe (in contrast to e.g. JDBC). The
|
||||
* shared Connection can be automatically recovered in case of an Exception.
|
||||
*
|
||||
@@ -170,7 +169,7 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
|
||||
* <p>Note that client IDs need to be unique among all active Connections
|
||||
* of the underlying JMS provider. Furthermore, a client ID can only be
|
||||
* assigned if the original ConnectionFactory hasn't already assigned one.
|
||||
* @see javax.jms.Connection#setClientID
|
||||
* @see jakarta.jms.Connection#setClientID
|
||||
* @see #setTargetConnectionFactory
|
||||
*/
|
||||
public void setClientId(@Nullable String clientId) {
|
||||
@@ -245,7 +244,7 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
|
||||
|
||||
@Override
|
||||
public Connection createConnection(String username, String password) throws JMSException {
|
||||
throw new javax.jms.IllegalStateException(
|
||||
throw new jakarta.jms.IllegalStateException(
|
||||
"SingleConnectionFactory does not support custom username and password");
|
||||
}
|
||||
|
||||
@@ -257,7 +256,7 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
|
||||
con = createConnection();
|
||||
}
|
||||
if (!(con instanceof QueueConnection)) {
|
||||
throw new javax.jms.IllegalStateException(
|
||||
throw new jakarta.jms.IllegalStateException(
|
||||
"This SingleConnectionFactory does not hold a QueueConnection but rather: " + con);
|
||||
}
|
||||
return ((QueueConnection) con);
|
||||
@@ -265,7 +264,7 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
|
||||
|
||||
@Override
|
||||
public QueueConnection createQueueConnection(String username, String password) throws JMSException {
|
||||
throw new javax.jms.IllegalStateException(
|
||||
throw new jakarta.jms.IllegalStateException(
|
||||
"SingleConnectionFactory does not support custom username and password");
|
||||
}
|
||||
|
||||
@@ -277,7 +276,7 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
|
||||
con = createConnection();
|
||||
}
|
||||
if (!(con instanceof TopicConnection)) {
|
||||
throw new javax.jms.IllegalStateException(
|
||||
throw new jakarta.jms.IllegalStateException(
|
||||
"This SingleConnectionFactory does not hold a TopicConnection but rather: " + con);
|
||||
}
|
||||
return ((TopicConnection) con);
|
||||
@@ -285,7 +284,7 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
|
||||
|
||||
@Override
|
||||
public TopicConnection createTopicConnection(String username, String password) throws JMSException {
|
||||
throw new javax.jms.IllegalStateException(
|
||||
throw new jakarta.jms.IllegalStateException(
|
||||
"SingleConnectionFactory does not support custom username and password");
|
||||
}
|
||||
|
||||
@@ -319,7 +318,7 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
|
||||
/**
|
||||
* Obtain an initialized shared Connection.
|
||||
* @return the Connection (never {@code null})
|
||||
* @throws javax.jms.JMSException if thrown by JMS API methods
|
||||
* @throws jakarta.jms.JMSException if thrown by JMS API methods
|
||||
* @see #initConnection()
|
||||
*/
|
||||
protected Connection getConnection() throws JMSException {
|
||||
@@ -335,7 +334,7 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
|
||||
* Initialize the underlying shared Connection.
|
||||
* <p>Closes and reinitializes the Connection if an underlying
|
||||
* Connection is present already.
|
||||
* @throws javax.jms.JMSException if thrown by JMS API methods
|
||||
* @throws jakarta.jms.JMSException if thrown by JMS API methods
|
||||
* @see #prepareConnection
|
||||
*/
|
||||
public void initConnection() throws JMSException {
|
||||
@@ -396,7 +395,7 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
|
||||
/**
|
||||
* Create a JMS Connection via this template's ConnectionFactory.
|
||||
* @return the new JMS Connection
|
||||
* @throws javax.jms.JMSException if thrown by JMS API methods
|
||||
* @throws jakarta.jms.JMSException if thrown by JMS API methods
|
||||
*/
|
||||
protected Connection doCreateConnection() throws JMSException {
|
||||
ConnectionFactory cf = getTargetConnectionFactory();
|
||||
@@ -502,7 +501,7 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
|
||||
con.close();
|
||||
}
|
||||
}
|
||||
catch (javax.jms.IllegalStateException ex) {
|
||||
catch (jakarta.jms.IllegalStateException ex) {
|
||||
logger.debug("Ignoring Connection state exception - assuming already closed: " + ex);
|
||||
}
|
||||
catch (Throwable ex) {
|
||||
@@ -569,7 +568,7 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
throw new javax.jms.IllegalStateException(
|
||||
throw new jakarta.jms.IllegalStateException(
|
||||
"setClientID call not supported on proxy for shared Connection. " +
|
||||
"Set the 'clientId' property on the SingleConnectionFactory instead.");
|
||||
}
|
||||
@@ -590,7 +589,7 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
throw new javax.jms.IllegalStateException(
|
||||
throw new jakarta.jms.IllegalStateException(
|
||||
"setExceptionListener call not supported on proxy for shared Connection. " +
|
||||
"Set the 'exceptionListener' property on the SingleConnectionFactory instead. " +
|
||||
"Alternatively, activate SingleConnectionFactory's 'reconnectOnException' feature, " +
|
||||
@@ -650,7 +649,7 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
|
||||
catch (Throwable ex) {
|
||||
logger.trace("Failed to close newly obtained JMS Session", ex);
|
||||
}
|
||||
throw new javax.jms.IllegalStateException(msg);
|
||||
throw new jakarta.jms.IllegalStateException(msg);
|
||||
}
|
||||
return session;
|
||||
}
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
package org.springframework.jms.connection;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import javax.jms.ConnectionFactory;
|
||||
import jakarta.jms.Connection;
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
|
||||
/**
|
||||
* Extension of the {@code javax.jms.ConnectionFactory} interface,
|
||||
* Extension of the {@code jakarta.jms.ConnectionFactory} interface,
|
||||
* indicating how to release Connections obtained from it.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
@@ -32,7 +32,7 @@ public interface SmartConnectionFactory extends ConnectionFactory {
|
||||
* Should we stop the Connection, obtained from this ConnectionFactory?
|
||||
* @param con the Connection to check
|
||||
* @return whether a stop call is necessary
|
||||
* @see javax.jms.Connection#stop()
|
||||
* @see jakarta.jms.Connection#stop()
|
||||
*/
|
||||
boolean shouldStop(Connection con);
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.jms.connection;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import jakarta.jms.JMSException;
|
||||
|
||||
import org.springframework.jms.JmsException;
|
||||
|
||||
|
||||
@@ -23,27 +23,27 @@ import java.lang.reflect.Proxy;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import javax.jms.ConnectionFactory;
|
||||
import javax.jms.JMSContext;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.QueueConnection;
|
||||
import javax.jms.QueueConnectionFactory;
|
||||
import javax.jms.QueueSession;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.TopicConnection;
|
||||
import javax.jms.TopicConnectionFactory;
|
||||
import javax.jms.TopicSession;
|
||||
import javax.jms.TransactionInProgressException;
|
||||
import jakarta.jms.Connection;
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
import jakarta.jms.JMSContext;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.QueueConnection;
|
||||
import jakarta.jms.QueueConnectionFactory;
|
||||
import jakarta.jms.QueueSession;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.TopicConnection;
|
||||
import jakarta.jms.TopicConnectionFactory;
|
||||
import jakarta.jms.TopicSession;
|
||||
import jakarta.jms.TransactionInProgressException;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
/**
|
||||
* Proxy for a target JMS {@link javax.jms.ConnectionFactory}, adding awareness of
|
||||
* Proxy for a target JMS {@link jakarta.jms.ConnectionFactory}, adding awareness of
|
||||
* Spring-managed transactions. Similar to a transactional JNDI ConnectionFactory
|
||||
* as provided by a Java EE application server.
|
||||
* as provided by a Jakarta EE application server.
|
||||
*
|
||||
* <p>Messaging code which should remain unaware of Spring's JMS support can work with
|
||||
* this proxy to seamlessly participate in Spring-managed transactions. Note that the
|
||||
@@ -164,7 +164,7 @@ public class TransactionAwareConnectionFactoryProxy
|
||||
public QueueConnection createQueueConnection() throws JMSException {
|
||||
ConnectionFactory target = getTargetConnectionFactory();
|
||||
if (!(target instanceof QueueConnectionFactory)) {
|
||||
throw new javax.jms.IllegalStateException("'targetConnectionFactory' is no QueueConnectionFactory");
|
||||
throw new jakarta.jms.IllegalStateException("'targetConnectionFactory' is no QueueConnectionFactory");
|
||||
}
|
||||
QueueConnection targetConnection = ((QueueConnectionFactory) target).createQueueConnection();
|
||||
return (QueueConnection) getTransactionAwareConnectionProxy(targetConnection);
|
||||
@@ -174,7 +174,7 @@ public class TransactionAwareConnectionFactoryProxy
|
||||
public QueueConnection createQueueConnection(String username, String password) throws JMSException {
|
||||
ConnectionFactory target = getTargetConnectionFactory();
|
||||
if (!(target instanceof QueueConnectionFactory)) {
|
||||
throw new javax.jms.IllegalStateException("'targetConnectionFactory' is no QueueConnectionFactory");
|
||||
throw new jakarta.jms.IllegalStateException("'targetConnectionFactory' is no QueueConnectionFactory");
|
||||
}
|
||||
QueueConnection targetConnection = ((QueueConnectionFactory) target).createQueueConnection(username, password);
|
||||
return (QueueConnection) getTransactionAwareConnectionProxy(targetConnection);
|
||||
@@ -184,7 +184,7 @@ public class TransactionAwareConnectionFactoryProxy
|
||||
public TopicConnection createTopicConnection() throws JMSException {
|
||||
ConnectionFactory target = getTargetConnectionFactory();
|
||||
if (!(target instanceof TopicConnectionFactory)) {
|
||||
throw new javax.jms.IllegalStateException("'targetConnectionFactory' is no TopicConnectionFactory");
|
||||
throw new jakarta.jms.IllegalStateException("'targetConnectionFactory' is no TopicConnectionFactory");
|
||||
}
|
||||
TopicConnection targetConnection = ((TopicConnectionFactory) target).createTopicConnection();
|
||||
return (TopicConnection) getTransactionAwareConnectionProxy(targetConnection);
|
||||
@@ -194,7 +194,7 @@ public class TransactionAwareConnectionFactoryProxy
|
||||
public TopicConnection createTopicConnection(String username, String password) throws JMSException {
|
||||
ConnectionFactory target = getTargetConnectionFactory();
|
||||
if (!(target instanceof TopicConnectionFactory)) {
|
||||
throw new javax.jms.IllegalStateException("'targetConnectionFactory' is no TopicConnectionFactory");
|
||||
throw new jakarta.jms.IllegalStateException("'targetConnectionFactory' is no TopicConnectionFactory");
|
||||
}
|
||||
TopicConnection targetConnection = ((TopicConnectionFactory) target).createTopicConnection(username, password);
|
||||
return (TopicConnection) getTransactionAwareConnectionProxy(targetConnection);
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
|
||||
package org.springframework.jms.connection;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import javax.jms.ConnectionFactory;
|
||||
import javax.jms.JMSContext;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.QueueConnection;
|
||||
import javax.jms.QueueConnectionFactory;
|
||||
import javax.jms.TopicConnection;
|
||||
import javax.jms.TopicConnectionFactory;
|
||||
import jakarta.jms.Connection;
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
import jakarta.jms.JMSContext;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.QueueConnection;
|
||||
import jakarta.jms.QueueConnectionFactory;
|
||||
import jakarta.jms.TopicConnection;
|
||||
import jakarta.jms.TopicConnectionFactory;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.core.NamedThreadLocal;
|
||||
@@ -32,7 +32,7 @@ import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* An adapter for a target JMS {@link javax.jms.ConnectionFactory}, applying the
|
||||
* An adapter for a target JMS {@link jakarta.jms.ConnectionFactory}, applying the
|
||||
* given user credentials to every standard {@code createConnection()} call,
|
||||
* that is, implicitly invoking {@code createConnection(username, password)}
|
||||
* on the target. All other methods simply delegate to the corresponding methods
|
||||
@@ -179,8 +179,8 @@ public class UserCredentialsConnectionFactoryAdapter
|
||||
* @param username the username to use
|
||||
* @param password the password to use
|
||||
* @return the Connection
|
||||
* @see javax.jms.ConnectionFactory#createConnection(String, String)
|
||||
* @see javax.jms.ConnectionFactory#createConnection()
|
||||
* @see jakarta.jms.ConnectionFactory#createConnection(String, String)
|
||||
* @see jakarta.jms.ConnectionFactory#createConnection()
|
||||
*/
|
||||
protected Connection doCreateConnection(@Nullable String username, @Nullable String password) throws JMSException {
|
||||
ConnectionFactory target = obtainTargetConnectionFactory();
|
||||
@@ -225,15 +225,15 @@ public class UserCredentialsConnectionFactoryAdapter
|
||||
* @param username the username to use
|
||||
* @param password the password to use
|
||||
* @return the Connection
|
||||
* @see javax.jms.QueueConnectionFactory#createQueueConnection(String, String)
|
||||
* @see javax.jms.QueueConnectionFactory#createQueueConnection()
|
||||
* @see jakarta.jms.QueueConnectionFactory#createQueueConnection(String, String)
|
||||
* @see jakarta.jms.QueueConnectionFactory#createQueueConnection()
|
||||
*/
|
||||
protected QueueConnection doCreateQueueConnection(
|
||||
@Nullable String username, @Nullable String password) throws JMSException {
|
||||
|
||||
ConnectionFactory target = obtainTargetConnectionFactory();
|
||||
if (!(target instanceof QueueConnectionFactory)) {
|
||||
throw new javax.jms.IllegalStateException("'targetConnectionFactory' is not a QueueConnectionFactory");
|
||||
throw new jakarta.jms.IllegalStateException("'targetConnectionFactory' is not a QueueConnectionFactory");
|
||||
}
|
||||
QueueConnectionFactory queueFactory = (QueueConnectionFactory) target;
|
||||
if (StringUtils.hasLength(username)) {
|
||||
@@ -277,15 +277,15 @@ public class UserCredentialsConnectionFactoryAdapter
|
||||
* @param username the username to use
|
||||
* @param password the password to use
|
||||
* @return the Connection
|
||||
* @see javax.jms.TopicConnectionFactory#createTopicConnection(String, String)
|
||||
* @see javax.jms.TopicConnectionFactory#createTopicConnection()
|
||||
* @see jakarta.jms.TopicConnectionFactory#createTopicConnection(String, String)
|
||||
* @see jakarta.jms.TopicConnectionFactory#createTopicConnection()
|
||||
*/
|
||||
protected TopicConnection doCreateTopicConnection(
|
||||
@Nullable String username, @Nullable String password) throws JMSException {
|
||||
|
||||
ConnectionFactory target = obtainTargetConnectionFactory();
|
||||
if (!(target instanceof TopicConnectionFactory)) {
|
||||
throw new javax.jms.IllegalStateException("'targetConnectionFactory' is not a TopicConnectionFactory");
|
||||
throw new jakarta.jms.IllegalStateException("'targetConnectionFactory' is not a TopicConnectionFactory");
|
||||
}
|
||||
TopicConnectionFactory queueFactory = (TopicConnectionFactory) target;
|
||||
if (StringUtils.hasLength(username)) {
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.jms.core;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.QueueBrowser;
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.QueueBrowser;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
@@ -39,13 +39,13 @@ import org.springframework.lang.Nullable;
|
||||
public interface BrowserCallback<T> {
|
||||
|
||||
/**
|
||||
* Perform operations on the given {@link javax.jms.Session} and
|
||||
* {@link javax.jms.QueueBrowser}.
|
||||
* Perform operations on the given {@link jakarta.jms.Session} and
|
||||
* {@link jakarta.jms.QueueBrowser}.
|
||||
* @param session the JMS {@code Session} object to use
|
||||
* @param browser the JMS {@code QueueBrowser} object to use
|
||||
* @return a result object from working with the {@code Session}, if any
|
||||
* (or {@code null} if none)
|
||||
* @throws javax.jms.JMSException if thrown by JMS API methods
|
||||
* @throws jakarta.jms.JMSException if thrown by JMS API methods
|
||||
*/
|
||||
@Nullable
|
||||
T doInJms(Session session, QueueBrowser browser) throws JMSException;
|
||||
|
||||
@@ -18,7 +18,7 @@ package org.springframework.jms.core;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.jms.Destination;
|
||||
import jakarta.jms.Destination;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.messaging.Message;
|
||||
@@ -31,7 +31,7 @@ import org.springframework.messaging.core.MessageSendingOperations;
|
||||
/**
|
||||
* A specialization of {@link MessageSendingOperations}, {@link MessageReceivingOperations}
|
||||
* and {@link MessageRequestReplyOperations} for JMS related operations that allow to specify
|
||||
* a destination name rather than the actual {@link javax.jms.Destination}.
|
||||
* a destination name rather than the actual {@link jakarta.jms.Destination}.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @since 4.1
|
||||
|
||||
@@ -18,10 +18,10 @@ package org.springframework.jms.core;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.jms.ConnectionFactory;
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
import jakarta.jms.Destination;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.jms.InvalidDestinationException;
|
||||
@@ -123,7 +123,7 @@ public class JmsMessagingTemplate extends AbstractMessagingTemplate<Destination>
|
||||
|
||||
/**
|
||||
* Set the {@link MessageConverter} to use to convert a {@link Message} from
|
||||
* the messaging to and from a {@link javax.jms.Message}. By default, a
|
||||
* the messaging to and from a {@link jakarta.jms.Message}. By default, a
|
||||
* {@link MessagingMessageConverter} is defined using a {@link SimpleMessageConverter}
|
||||
* to convert the payload of the message.
|
||||
* <p>Consider configuring a {@link MessagingMessageConverter} with a different
|
||||
@@ -139,7 +139,7 @@ public class JmsMessagingTemplate extends AbstractMessagingTemplate<Destination>
|
||||
|
||||
/**
|
||||
* Return the {@link MessageConverter} to use to convert a {@link Message}
|
||||
* from the messaging to and from a {@link javax.jms.Message}.
|
||||
* from the messaging to and from a {@link jakarta.jms.Message}.
|
||||
*/
|
||||
public MessageConverter getJmsMessageConverter() {
|
||||
return this.jmsMessageConverter;
|
||||
@@ -373,7 +373,7 @@ public class JmsMessagingTemplate extends AbstractMessagingTemplate<Destination>
|
||||
@Nullable
|
||||
protected Message<?> doReceive(Destination destination) {
|
||||
try {
|
||||
javax.jms.Message jmsMessage = obtainJmsTemplate().receive(destination);
|
||||
jakarta.jms.Message jmsMessage = obtainJmsTemplate().receive(destination);
|
||||
return convertJmsMessage(jmsMessage);
|
||||
}
|
||||
catch (JmsException ex) {
|
||||
@@ -384,7 +384,7 @@ public class JmsMessagingTemplate extends AbstractMessagingTemplate<Destination>
|
||||
@Nullable
|
||||
protected Message<?> doReceive(String destinationName) {
|
||||
try {
|
||||
javax.jms.Message jmsMessage = obtainJmsTemplate().receive(destinationName);
|
||||
jakarta.jms.Message jmsMessage = obtainJmsTemplate().receive(destinationName);
|
||||
return convertJmsMessage(jmsMessage);
|
||||
}
|
||||
catch (JmsException ex) {
|
||||
@@ -396,7 +396,7 @@ public class JmsMessagingTemplate extends AbstractMessagingTemplate<Destination>
|
||||
@Nullable
|
||||
protected Message<?> doSendAndReceive(Destination destination, Message<?> requestMessage) {
|
||||
try {
|
||||
javax.jms.Message jmsMessage = obtainJmsTemplate().sendAndReceive(
|
||||
jakarta.jms.Message jmsMessage = obtainJmsTemplate().sendAndReceive(
|
||||
destination, createMessageCreator(requestMessage));
|
||||
return convertJmsMessage(jmsMessage);
|
||||
}
|
||||
@@ -408,7 +408,7 @@ public class JmsMessagingTemplate extends AbstractMessagingTemplate<Destination>
|
||||
@Nullable
|
||||
protected Message<?> doSendAndReceive(String destinationName, Message<?> requestMessage) {
|
||||
try {
|
||||
javax.jms.Message jmsMessage = obtainJmsTemplate().sendAndReceive(
|
||||
jakarta.jms.Message jmsMessage = obtainJmsTemplate().sendAndReceive(
|
||||
destinationName, createMessageCreator(requestMessage));
|
||||
return convertJmsMessage(jmsMessage);
|
||||
}
|
||||
@@ -431,7 +431,7 @@ public class JmsMessagingTemplate extends AbstractMessagingTemplate<Destination>
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected Message<?> convertJmsMessage(@Nullable javax.jms.Message message) {
|
||||
protected Message<?> convertJmsMessage(@Nullable jakarta.jms.Message message) {
|
||||
if (message == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -468,7 +468,7 @@ public class JmsMessagingTemplate extends AbstractMessagingTemplate<Destination>
|
||||
}
|
||||
|
||||
@Override
|
||||
public javax.jms.Message createMessage(Session session) throws JMSException {
|
||||
public jakarta.jms.Message createMessage(Session session) throws JMSException {
|
||||
try {
|
||||
return this.messageConverter.toMessage(this.message, session);
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.jms.core;
|
||||
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.Queue;
|
||||
import jakarta.jms.Destination;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.Queue;
|
||||
|
||||
import org.springframework.jms.JmsException;
|
||||
import org.springframework.lang.Nullable;
|
||||
@@ -41,10 +41,10 @@ import org.springframework.lang.Nullable;
|
||||
* @author Stephane Nicoll
|
||||
* @since 1.1
|
||||
* @see JmsTemplate
|
||||
* @see javax.jms.Destination
|
||||
* @see javax.jms.Session
|
||||
* @see javax.jms.MessageProducer
|
||||
* @see javax.jms.MessageConsumer
|
||||
* @see jakarta.jms.Destination
|
||||
* @see jakarta.jms.Session
|
||||
* @see jakarta.jms.MessageProducer
|
||||
* @see jakarta.jms.MessageConsumer
|
||||
*/
|
||||
public interface JmsOperations {
|
||||
|
||||
|
||||
@@ -16,18 +16,18 @@
|
||||
|
||||
package org.springframework.jms.core;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import javax.jms.ConnectionFactory;
|
||||
import javax.jms.DeliveryMode;
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.MessageConsumer;
|
||||
import javax.jms.MessageProducer;
|
||||
import javax.jms.Queue;
|
||||
import javax.jms.QueueBrowser;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.TemporaryQueue;
|
||||
import jakarta.jms.Connection;
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
import jakarta.jms.DeliveryMode;
|
||||
import jakarta.jms.Destination;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.MessageConsumer;
|
||||
import jakarta.jms.MessageProducer;
|
||||
import jakarta.jms.Queue;
|
||||
import jakarta.jms.QueueBrowser;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.TemporaryQueue;
|
||||
|
||||
import org.springframework.jms.JmsException;
|
||||
import org.springframework.jms.connection.ConnectionFactoryUtils;
|
||||
@@ -50,7 +50,7 @@ import org.springframework.util.Assert;
|
||||
* domain.
|
||||
*
|
||||
* <p>Default settings for JMS Sessions are "not transacted" and "auto-acknowledge".
|
||||
* As defined by the Java EE specification, the transaction and acknowledgement
|
||||
* As defined by the Jakarta EE specification, the transaction and acknowledgement
|
||||
* parameters are ignored when a JMS Session is created inside an active
|
||||
* transaction, no matter if a JTA transaction or a Spring-managed transaction.
|
||||
* To configure them for native JMS usage, specify appropriate values for
|
||||
@@ -70,7 +70,7 @@ import org.springframework.util.Assert;
|
||||
* {@link org.springframework.jms.connection.SingleConnectionFactory} as a
|
||||
* decorator for your target {@code ConnectionFactory}, reusing a single
|
||||
* JMS Connection in a thread-safe fashion; this is often good enough for the
|
||||
* purpose of sending messages via this template. In a Java EE environment,
|
||||
* purpose of sending messages via this template. In a Jakarta EE environment,
|
||||
* make sure that the {@code ConnectionFactory} is obtained from the
|
||||
* application's environment naming context via JNDI; application servers
|
||||
* typically expose pooled, transaction-aware factories there.
|
||||
@@ -83,8 +83,8 @@ import org.springframework.util.Assert;
|
||||
* @see #setPubSubDomain
|
||||
* @see #setDestinationResolver
|
||||
* @see #setMessageConverter
|
||||
* @see javax.jms.MessageProducer
|
||||
* @see javax.jms.MessageConsumer
|
||||
* @see jakarta.jms.MessageProducer
|
||||
* @see jakarta.jms.MessageConsumer
|
||||
*/
|
||||
public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations {
|
||||
|
||||
@@ -195,7 +195,7 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations
|
||||
* @see #convertAndSend(Object)
|
||||
* @see #convertAndSend(Object, MessagePostProcessor)
|
||||
* @see #setDestinationResolver
|
||||
* @see #setDefaultDestination(javax.jms.Destination)
|
||||
* @see #setDefaultDestination(jakarta.jms.Destination)
|
||||
*/
|
||||
public void setDefaultDestinationName(@Nullable String destinationName) {
|
||||
this.defaultDestination = destinationName;
|
||||
@@ -254,7 +254,7 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations
|
||||
* Set whether message IDs are enabled. Default is "true".
|
||||
* <p>This is only a hint to the JMS producer.
|
||||
* See the JMS javadocs for details.
|
||||
* @see javax.jms.MessageProducer#setDisableMessageID
|
||||
* @see jakarta.jms.MessageProducer#setDisableMessageID
|
||||
*/
|
||||
public void setMessageIdEnabled(boolean messageIdEnabled) {
|
||||
this.messageIdEnabled = messageIdEnabled;
|
||||
@@ -271,7 +271,7 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations
|
||||
* Set whether message timestamps are enabled. Default is "true".
|
||||
* <p>This is only a hint to the JMS producer.
|
||||
* See the JMS javadocs for details.
|
||||
* @see javax.jms.MessageProducer#setDisableMessageTimestamp
|
||||
* @see jakarta.jms.MessageProducer#setDisableMessageTimestamp
|
||||
*/
|
||||
public void setMessageTimestampEnabled(boolean messageTimestampEnabled) {
|
||||
this.messageTimestampEnabled = messageTimestampEnabled;
|
||||
@@ -287,7 +287,7 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations
|
||||
/**
|
||||
* Set whether to inhibit the delivery of messages published by its own connection.
|
||||
* Default is "false".
|
||||
* @see javax.jms.Session#createConsumer(javax.jms.Destination, String, boolean)
|
||||
* @see jakarta.jms.Session#createConsumer(jakarta.jms.Destination, String, boolean)
|
||||
*/
|
||||
public void setPubSubNoLocal(boolean pubSubNoLocal) {
|
||||
this.pubSubNoLocal = pubSubNoLocal;
|
||||
@@ -308,9 +308,9 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations
|
||||
* to indicate that a receive operation should check if a message is
|
||||
* immediately available without blocking.
|
||||
* @see #receiveFromConsumer(MessageConsumer, long)
|
||||
* @see javax.jms.MessageConsumer#receive(long)
|
||||
* @see javax.jms.MessageConsumer#receiveNoWait()
|
||||
* @see javax.jms.MessageConsumer#receive()
|
||||
* @see jakarta.jms.MessageConsumer#receive(long)
|
||||
* @see jakarta.jms.MessageConsumer#receiveNoWait()
|
||||
* @see jakarta.jms.MessageConsumer#receive()
|
||||
*/
|
||||
public void setReceiveTimeout(long receiveTimeout) {
|
||||
this.receiveTimeout = receiveTimeout;
|
||||
@@ -388,8 +388,8 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations
|
||||
* mode accordingly, to either "PERSISTENT" (2) or "NON_PERSISTENT" (1).
|
||||
* <p>Default is "true" a.k.a. delivery mode "PERSISTENT".
|
||||
* @see #setDeliveryMode(int)
|
||||
* @see javax.jms.DeliveryMode#PERSISTENT
|
||||
* @see javax.jms.DeliveryMode#NON_PERSISTENT
|
||||
* @see jakarta.jms.DeliveryMode#PERSISTENT
|
||||
* @see jakarta.jms.DeliveryMode#NON_PERSISTENT
|
||||
*/
|
||||
public void setDeliveryPersistent(boolean deliveryPersistent) {
|
||||
this.deliveryMode = (deliveryPersistent ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
|
||||
@@ -402,10 +402,10 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations
|
||||
* this is only used when "isExplicitQosEnabled" equals "true".
|
||||
* @param deliveryMode the delivery mode to use
|
||||
* @see #isExplicitQosEnabled
|
||||
* @see javax.jms.DeliveryMode#PERSISTENT
|
||||
* @see javax.jms.DeliveryMode#NON_PERSISTENT
|
||||
* @see javax.jms.Message#DEFAULT_DELIVERY_MODE
|
||||
* @see javax.jms.MessageProducer#send(javax.jms.Message, int, int, long)
|
||||
* @see jakarta.jms.DeliveryMode#PERSISTENT
|
||||
* @see jakarta.jms.DeliveryMode#NON_PERSISTENT
|
||||
* @see jakarta.jms.Message#DEFAULT_DELIVERY_MODE
|
||||
* @see jakarta.jms.MessageProducer#send(jakarta.jms.Message, int, int, long)
|
||||
*/
|
||||
public void setDeliveryMode(int deliveryMode) {
|
||||
this.deliveryMode = deliveryMode;
|
||||
@@ -423,8 +423,8 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations
|
||||
* <p>Since a default value may be defined administratively,
|
||||
* this is only used when "isExplicitQosEnabled" equals "true".
|
||||
* @see #isExplicitQosEnabled
|
||||
* @see javax.jms.Message#DEFAULT_PRIORITY
|
||||
* @see javax.jms.MessageProducer#send(javax.jms.Message, int, int, long)
|
||||
* @see jakarta.jms.Message#DEFAULT_PRIORITY
|
||||
* @see jakarta.jms.MessageProducer#send(jakarta.jms.Message, int, int, long)
|
||||
*/
|
||||
public void setPriority(int priority) {
|
||||
this.priority = priority;
|
||||
@@ -443,8 +443,8 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations
|
||||
* this is only used when "isExplicitQosEnabled" equals "true".
|
||||
* @param timeToLive the message's lifetime (in milliseconds)
|
||||
* @see #isExplicitQosEnabled
|
||||
* @see javax.jms.Message#DEFAULT_TIME_TO_LIVE
|
||||
* @see javax.jms.MessageProducer#send(javax.jms.Message, int, int, long)
|
||||
* @see jakarta.jms.Message#DEFAULT_TIME_TO_LIVE
|
||||
* @see jakarta.jms.MessageProducer#send(jakarta.jms.Message, int, int, long)
|
||||
*/
|
||||
public void setTimeToLive(long timeToLive) {
|
||||
this.timeToLive = timeToLive;
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.jms.core;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
/**
|
||||
* Creates a JMS message given a {@link Session}.
|
||||
@@ -27,7 +27,7 @@ import javax.jms.Session;
|
||||
* of the {@link JmsTemplate} class.
|
||||
*
|
||||
* <p>Implementations <i>do not</i> need to concern themselves with
|
||||
* checked {@code JMSExceptions} (from the '{@code javax.jms}'
|
||||
* checked {@code JMSExceptions} (from the '{@code jakarta.jms}'
|
||||
* package) that may be thrown from operations they attempt. The
|
||||
* {@code JmsTemplate} will catch and handle these
|
||||
* {@code JMSExceptions} appropriately.
|
||||
@@ -43,7 +43,7 @@ public interface MessageCreator {
|
||||
* @param session the JMS {@link Session} to be used to create the
|
||||
* {@code Message} (never {@code null})
|
||||
* @return the {@code Message} to be sent
|
||||
* @throws javax.jms.JMSException if thrown by JMS API methods
|
||||
* @throws jakarta.jms.JMSException if thrown by JMS API methods
|
||||
*/
|
||||
Message createMessage(Session session) throws JMSException;
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package org.springframework.jms.core;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
|
||||
/**
|
||||
* To be used with JmsTemplate's send method that converts an object to a message.
|
||||
@@ -30,7 +30,7 @@ import javax.jms.Message;
|
||||
* @author Mark Pollack
|
||||
* @since 1.1
|
||||
* @see JmsTemplate#convertAndSend(String, Object, MessagePostProcessor)
|
||||
* @see JmsTemplate#convertAndSend(javax.jms.Destination, Object, MessagePostProcessor)
|
||||
* @see JmsTemplate#convertAndSend(jakarta.jms.Destination, Object, MessagePostProcessor)
|
||||
* @see org.springframework.jms.support.converter.MessageConverter
|
||||
*/
|
||||
@FunctionalInterface
|
||||
@@ -42,7 +42,7 @@ public interface MessagePostProcessor {
|
||||
* @param message the JMS message from the MessageConverter
|
||||
* @return a post-processed variant of the message, or simply the incoming
|
||||
* message; never {@code null}
|
||||
* @throws javax.jms.JMSException if thrown by JMS API methods
|
||||
* @throws jakarta.jms.JMSException if thrown by JMS API methods
|
||||
*/
|
||||
Message postProcessMessage(Message message) throws JMSException;
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.jms.core;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.MessageProducer;
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.MessageProducer;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
@@ -36,7 +36,7 @@ import org.springframework.lang.Nullable;
|
||||
* @since 1.1
|
||||
* @param <T> the result type
|
||||
* @see JmsTemplate#execute(ProducerCallback)
|
||||
* @see JmsTemplate#execute(javax.jms.Destination, ProducerCallback)
|
||||
* @see JmsTemplate#execute(jakarta.jms.Destination, ProducerCallback)
|
||||
* @see JmsTemplate#execute(String, ProducerCallback)
|
||||
*/
|
||||
@FunctionalInterface
|
||||
@@ -50,7 +50,7 @@ public interface ProducerCallback<T> {
|
||||
* @param producer the JMS {@code MessageProducer} object to use
|
||||
* @return a result object from working with the {@code Session}, if any
|
||||
* (or {@code null} if none)
|
||||
* @throws javax.jms.JMSException if thrown by JMS API methods
|
||||
* @throws jakarta.jms.JMSException if thrown by JMS API methods
|
||||
*/
|
||||
@Nullable
|
||||
T doInJms(Session session, MessageProducer producer) throws JMSException;
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package org.springframework.jms.core;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
@@ -41,7 +41,7 @@ public interface SessionCallback<T> {
|
||||
* @param session the JMS {@code Session}
|
||||
* @return a result object from working with the {@code Session}, if any
|
||||
* (or {@code null} if none)
|
||||
* @throws javax.jms.JMSException if thrown by JMS API methods
|
||||
* @throws jakarta.jms.JMSException if thrown by JMS API methods
|
||||
*/
|
||||
@Nullable
|
||||
T doInJms(Session session) throws JMSException;
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
|
||||
package org.springframework.jms.core.support;
|
||||
|
||||
import javax.jms.ConnectionFactory;
|
||||
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
@@ -54,7 +53,7 @@ public abstract class JmsGatewaySupport implements InitializingBean {
|
||||
* Set the JMS connection factory to be used by the gateway.
|
||||
* Will automatically create a JmsTemplate for the given ConnectionFactory.
|
||||
* @see #createJmsTemplate
|
||||
* @see #setConnectionFactory(javax.jms.ConnectionFactory)
|
||||
* @see #setConnectionFactory(jakarta.jms.ConnectionFactory)
|
||||
*/
|
||||
public final void setConnectionFactory(ConnectionFactory connectionFactory) {
|
||||
this.jmsTemplate = createJmsTemplate(connectionFactory);
|
||||
@@ -83,7 +82,7 @@ public abstract class JmsGatewaySupport implements InitializingBean {
|
||||
|
||||
/**
|
||||
* Set the JmsTemplate for the gateway.
|
||||
* @see #setConnectionFactory(javax.jms.ConnectionFactory)
|
||||
* @see #setConnectionFactory(jakarta.jms.ConnectionFactory)
|
||||
*/
|
||||
public final void setJmsTemplate(@Nullable JmsTemplate jmsTemplate) {
|
||||
this.jmsTemplate = jmsTemplate;
|
||||
|
||||
@@ -20,8 +20,8 @@ import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import javax.jms.JMSException;
|
||||
import jakarta.jms.Connection;
|
||||
import jakarta.jms.JMSException;
|
||||
|
||||
import org.springframework.beans.factory.BeanNameAware;
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
@@ -94,7 +94,7 @@ public abstract class AbstractJmsListeningContainer extends JmsDestinationAccess
|
||||
* <p>Note that client IDs need to be unique among all active Connections
|
||||
* of the underlying JMS provider. Furthermore, a client ID can only be
|
||||
* assigned if the original ConnectionFactory hasn't already assigned one.
|
||||
* @see javax.jms.Connection#setClientID
|
||||
* @see jakarta.jms.Connection#setClientID
|
||||
* @see #setConnectionFactory
|
||||
*/
|
||||
public void setClientId(@Nullable String clientId) {
|
||||
@@ -191,7 +191,7 @@ public abstract class AbstractJmsListeningContainer extends JmsDestinationAccess
|
||||
|
||||
/**
|
||||
* Initialize this container.
|
||||
* <p>Creates a JMS Connection, starts the {@link javax.jms.Connection}
|
||||
* <p>Creates a JMS Connection, starts the {@link jakarta.jms.Connection}
|
||||
* (if {@link #setAutoStartup(boolean) "autoStartup"} hasn't been turned off),
|
||||
* and calls {@link #doInitialize()}.
|
||||
* @throws org.springframework.jms.JmsException if startup failed
|
||||
@@ -439,7 +439,7 @@ public abstract class AbstractJmsListeningContainer extends JmsDestinationAccess
|
||||
/**
|
||||
* Start the shared Connection.
|
||||
* @throws JMSException if thrown by JMS API methods
|
||||
* @see javax.jms.Connection#start()
|
||||
* @see jakarta.jms.Connection#start()
|
||||
*/
|
||||
protected void startSharedConnection() throws JMSException {
|
||||
synchronized (this.sharedConnectionMonitor) {
|
||||
@@ -448,7 +448,7 @@ public abstract class AbstractJmsListeningContainer extends JmsDestinationAccess
|
||||
try {
|
||||
this.sharedConnection.start();
|
||||
}
|
||||
catch (javax.jms.IllegalStateException ex) {
|
||||
catch (jakarta.jms.IllegalStateException ex) {
|
||||
logger.debug("Ignoring Connection start exception - assuming already started: " + ex);
|
||||
}
|
||||
}
|
||||
@@ -458,7 +458,7 @@ public abstract class AbstractJmsListeningContainer extends JmsDestinationAccess
|
||||
/**
|
||||
* Stop the shared Connection.
|
||||
* @throws JMSException if thrown by JMS API methods
|
||||
* @see javax.jms.Connection#start()
|
||||
* @see jakarta.jms.Connection#start()
|
||||
*/
|
||||
protected void stopSharedConnection() throws JMSException {
|
||||
synchronized (this.sharedConnectionMonitor) {
|
||||
@@ -467,7 +467,7 @@ public abstract class AbstractJmsListeningContainer extends JmsDestinationAccess
|
||||
try {
|
||||
this.sharedConnection.stop();
|
||||
}
|
||||
catch (javax.jms.IllegalStateException ex) {
|
||||
catch (jakarta.jms.IllegalStateException ex) {
|
||||
logger.debug("Ignoring Connection stop exception - assuming already stopped: " + ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,16 +16,16 @@
|
||||
|
||||
package org.springframework.jms.listener;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.ExceptionListener;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.MessageConsumer;
|
||||
import javax.jms.MessageListener;
|
||||
import javax.jms.Queue;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.Topic;
|
||||
import jakarta.jms.Connection;
|
||||
import jakarta.jms.Destination;
|
||||
import jakarta.jms.ExceptionListener;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.MessageConsumer;
|
||||
import jakarta.jms.MessageListener;
|
||||
import jakarta.jms.Queue;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.Topic;
|
||||
|
||||
import org.springframework.jms.support.JmsUtils;
|
||||
import org.springframework.jms.support.QosSettings;
|
||||
@@ -35,12 +35,12 @@ import org.springframework.util.ErrorHandler;
|
||||
|
||||
/**
|
||||
* Abstract base class for Spring message listener container implementations.
|
||||
* Can either host a standard JMS {@link javax.jms.MessageListener} or Spring's
|
||||
* Can either host a standard JMS {@link jakarta.jms.MessageListener} or Spring's
|
||||
* {@link SessionAwareMessageListener} for actual message processing.
|
||||
*
|
||||
* <p>Usually holds a single JMS {@link Connection} that all listeners are supposed
|
||||
* to be registered on, which is the standard JMS way of managing listener sessions.
|
||||
* Can alternatively also be used with a fresh Connection per listener, for Java EE
|
||||
* Can alternatively also be used with a fresh Connection per listener, for Jakarta EE
|
||||
* style XA-aware JMS messaging. The actual registration process is up to concrete
|
||||
* subclasses.
|
||||
*
|
||||
@@ -99,7 +99,7 @@ import org.springframework.util.ErrorHandler;
|
||||
* supported by {@link DefaultMessageListenerContainer}, through specifying
|
||||
* an external "transactionManager" (typically a
|
||||
* {@link org.springframework.transaction.jta.JtaTransactionManager}, with
|
||||
* a corresponding XA-aware JMS {@link javax.jms.ConnectionFactory} passed in
|
||||
* a corresponding XA-aware JMS {@link jakarta.jms.ConnectionFactory} passed in
|
||||
* as "connectionFactory").
|
||||
* </ul>
|
||||
* Note that XA transaction coordination adds significant runtime overhead,
|
||||
@@ -116,7 +116,7 @@ import org.springframework.util.ErrorHandler;
|
||||
* <li>Alternatively, specify a
|
||||
* {@link org.springframework.transaction.jta.JtaTransactionManager} as
|
||||
* "transactionManager" for a fully XA-aware JMS provider - typically when
|
||||
* running on a Java EE server, but also for other environments with a JTA
|
||||
* running on a Jakarta EE server, but also for other environments with a JTA
|
||||
* transaction manager present. This will give full "exactly-once" guarantees
|
||||
* without custom duplicate message checks, at the price of additional
|
||||
* runtime processing overhead.
|
||||
@@ -132,7 +132,7 @@ import org.springframework.util.ErrorHandler;
|
||||
* @author Stephane Nicoll
|
||||
* @since 2.0
|
||||
* @see #setMessageListener
|
||||
* @see javax.jms.MessageListener
|
||||
* @see jakarta.jms.MessageListener
|
||||
* @see SessionAwareMessageListener
|
||||
* @see #handleListenerException
|
||||
* @see DefaultMessageListenerContainer
|
||||
@@ -222,7 +222,7 @@ public abstract class AbstractMessageListenerContainer extends AbstractJmsListen
|
||||
* container picking up the new destination immediately (works e.g. with
|
||||
* DefaultMessageListenerContainer, as long as the cache level is less than
|
||||
* CACHE_CONSUMER). However, this is considered advanced usage; use it with care!
|
||||
* @see #setDestination(javax.jms.Destination)
|
||||
* @see #setDestination(jakarta.jms.Destination)
|
||||
*/
|
||||
public void setDestinationName(@Nullable String destinationName) {
|
||||
this.destination = destinationName;
|
||||
@@ -280,7 +280,7 @@ public abstract class AbstractMessageListenerContainer extends AbstractJmsListen
|
||||
* CACHE_CONSUMER). However, this is considered advanced usage; use it with care!
|
||||
* @throws IllegalArgumentException if the supplied listener is not a
|
||||
* {@link MessageListener} or a {@link SessionAwareMessageListener}
|
||||
* @see javax.jms.MessageListener
|
||||
* @see jakarta.jms.MessageListener
|
||||
* @see SessionAwareMessageListener
|
||||
*/
|
||||
public void setMessageListener(@Nullable Object messageListener) {
|
||||
@@ -307,7 +307,7 @@ public abstract class AbstractMessageListenerContainer extends AbstractJmsListen
|
||||
* @param messageListener the message listener object to check
|
||||
* @throws IllegalArgumentException if the supplied listener is not a
|
||||
* {@link MessageListener} or a {@link SessionAwareMessageListener}
|
||||
* @see javax.jms.MessageListener
|
||||
* @see jakarta.jms.MessageListener
|
||||
* @see SessionAwareMessageListener
|
||||
*/
|
||||
protected void checkMessageListener(@Nullable Object messageListener) {
|
||||
@@ -449,7 +449,7 @@ public abstract class AbstractMessageListenerContainer extends AbstractJmsListen
|
||||
* Set whether to inhibit the delivery of messages published by its own connection.
|
||||
* Default is "false".
|
||||
* @since 4.1
|
||||
* @see javax.jms.Session#createConsumer(javax.jms.Destination, String, boolean)
|
||||
* @see jakarta.jms.Session#createConsumer(jakarta.jms.Destination, String, boolean)
|
||||
*/
|
||||
public void setPubSubNoLocal(boolean pubSubNoLocal) {
|
||||
this.pubSubNoLocal = pubSubNoLocal;
|
||||
@@ -478,8 +478,8 @@ public abstract class AbstractMessageListenerContainer extends AbstractJmsListen
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether the Publish/Subscribe domain ({@link javax.jms.Topic Topics}) is used
|
||||
* for replies. Otherwise, the Point-to-Point domain ({@link javax.jms.Queue Queues})
|
||||
* Return whether the Publish/Subscribe domain ({@link jakarta.jms.Topic Topics}) is used
|
||||
* for replies. Otherwise, the Point-to-Point domain ({@link jakarta.jms.Queue Queues})
|
||||
* is used.
|
||||
* @since 4.2
|
||||
*/
|
||||
@@ -755,7 +755,7 @@ public abstract class AbstractMessageListenerContainer extends AbstractJmsListen
|
||||
* @param listener the JMS MessageListener to invoke
|
||||
* @param message the received JMS Message
|
||||
* @throws JMSException if thrown by JMS API methods
|
||||
* @see javax.jms.MessageListener#onMessage
|
||||
* @see jakarta.jms.MessageListener#onMessage
|
||||
*/
|
||||
protected void doInvokeListener(MessageListener listener, Message message) throws JMSException {
|
||||
listener.onMessage(message);
|
||||
@@ -765,7 +765,7 @@ public abstract class AbstractMessageListenerContainer extends AbstractJmsListen
|
||||
* Perform a commit or message acknowledgement, as appropriate.
|
||||
* @param session the JMS Session to commit
|
||||
* @param message the Message to acknowledge
|
||||
* @throws javax.jms.JMSException in case of commit failure
|
||||
* @throws jakarta.jms.JMSException in case of commit failure
|
||||
*/
|
||||
protected void commitIfNecessary(Session session, @Nullable Message message) throws JMSException {
|
||||
// Commit session or acknowledge message.
|
||||
@@ -784,7 +784,7 @@ public abstract class AbstractMessageListenerContainer extends AbstractJmsListen
|
||||
/**
|
||||
* Perform a rollback, if appropriate.
|
||||
* @param session the JMS Session to rollback
|
||||
* @throws javax.jms.JMSException in case of a rollback error
|
||||
* @throws jakarta.jms.JMSException in case of a rollback error
|
||||
*/
|
||||
protected void rollbackIfNecessary(Session session) throws JMSException {
|
||||
if (session.getTransacted()) {
|
||||
@@ -802,7 +802,7 @@ public abstract class AbstractMessageListenerContainer extends AbstractJmsListen
|
||||
* Perform a rollback, handling rollback exceptions properly.
|
||||
* @param session the JMS Session to rollback
|
||||
* @param ex the thrown application exception or error
|
||||
* @throws javax.jms.JMSException in case of a rollback error
|
||||
* @throws jakarta.jms.JMSException in case of a rollback error
|
||||
*/
|
||||
protected void rollbackOnExceptionIfNecessary(Session session, Throwable ex) throws JMSException {
|
||||
try {
|
||||
@@ -850,7 +850,7 @@ public abstract class AbstractMessageListenerContainer extends AbstractJmsListen
|
||||
* @param session the JMS Session to create a MessageConsumer for
|
||||
* @param destination the JMS Destination to create a MessageConsumer for
|
||||
* @return the new JMS MessageConsumer
|
||||
* @throws javax.jms.JMSException if thrown by JMS API methods
|
||||
* @throws jakarta.jms.JMSException if thrown by JMS API methods
|
||||
*/
|
||||
protected MessageConsumer createConsumer(Session session, Destination destination) throws JMSException {
|
||||
if (isPubSubDomain() && destination instanceof Topic) {
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
|
||||
package org.springframework.jms.listener;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.MessageConsumer;
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.Connection;
|
||||
import jakarta.jms.Destination;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.MessageConsumer;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
import org.springframework.jms.connection.ConnectionFactoryUtils;
|
||||
import org.springframework.jms.connection.JmsResourceHolder;
|
||||
@@ -38,7 +38,7 @@ import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Base class for listener container implementations which are based on polling.
|
||||
* Provides support for listener handling based on {@link javax.jms.MessageConsumer},
|
||||
* Provides support for listener handling based on {@link jakarta.jms.MessageConsumer},
|
||||
* optionally participating in externally managed transactions.
|
||||
*
|
||||
* <p>This listener container variant is built for repeated polling attempts,
|
||||
@@ -48,7 +48,7 @@ import org.springframework.util.Assert;
|
||||
* configured through the {@link #setReceiveTimeout "receiveTimeout"} property.
|
||||
*
|
||||
* <p>The underlying mechanism is based on standard JMS MessageConsumer handling,
|
||||
* which is perfectly compatible with both native JMS and JMS in a Java EE environment.
|
||||
* which is perfectly compatible with both native JMS and JMS in a Jakarta EE environment.
|
||||
* Neither the JMS {@code MessageConsumer.setMessageListener} facility nor the JMS
|
||||
* ServerSessionPool facility is required. A further advantage of this approach is
|
||||
* full control over the listening process, allowing for custom scaling and throttling
|
||||
@@ -59,7 +59,7 @@ import org.springframework.util.Assert;
|
||||
* {@link org.springframework.transaction.PlatformTransactionManager} into the
|
||||
* {@link #setTransactionManager "transactionManager"} property. This will usually
|
||||
* be a {@link org.springframework.transaction.jta.JtaTransactionManager} in a
|
||||
* Java EE environment, in combination with a JTA-aware JMS ConnectionFactory
|
||||
* Jakarta EE environment, in combination with a JTA-aware JMS ConnectionFactory
|
||||
* obtained from JNDI (check your application server's documentation).
|
||||
*
|
||||
* <p>This base class does not assume any specific mechanism for asynchronous
|
||||
@@ -165,9 +165,9 @@ public abstract class AbstractPollingMessageListenerContainer extends AbstractMe
|
||||
* discouraged since such a listener container cannot cleanly shut down.
|
||||
* A negative value such as -1 indicates a no-wait receive operation.
|
||||
* @see #receiveFromConsumer(MessageConsumer, long)
|
||||
* @see javax.jms.MessageConsumer#receive(long)
|
||||
* @see javax.jms.MessageConsumer#receiveNoWait()
|
||||
* @see javax.jms.MessageConsumer#receive()
|
||||
* @see jakarta.jms.MessageConsumer#receive(long)
|
||||
* @see jakarta.jms.MessageConsumer#receiveNoWait()
|
||||
* @see jakarta.jms.MessageConsumer#receive()
|
||||
* @see #setTransactionTimeout
|
||||
*/
|
||||
public void setReceiveTimeout(long receiveTimeout) {
|
||||
@@ -211,7 +211,7 @@ public abstract class AbstractPollingMessageListenerContainer extends AbstractMe
|
||||
* registering a MessageListener for the specified listener.
|
||||
* @param session the JMS Session to work on
|
||||
* @return the MessageConsumer
|
||||
* @throws javax.jms.JMSException if thrown by JMS methods
|
||||
* @throws jakarta.jms.JMSException if thrown by JMS methods
|
||||
* @see #receiveAndExecute
|
||||
*/
|
||||
protected MessageConsumer createListenerConsumer(Session session) throws JMSException {
|
||||
@@ -266,7 +266,7 @@ public abstract class AbstractPollingMessageListenerContainer extends AbstractMe
|
||||
* @param status the TransactionStatus (may be {@code null})
|
||||
* @return whether a message has been received
|
||||
* @throws JMSException if thrown by JMS methods
|
||||
* @see #doExecuteListener(javax.jms.Session, javax.jms.Message)
|
||||
* @see #doExecuteListener(jakarta.jms.Session, jakarta.jms.Message)
|
||||
*/
|
||||
protected boolean doReceiveAndExecute(Object invoker, @Nullable Session session,
|
||||
@Nullable MessageConsumer consumer, @Nullable TransactionStatus status) throws JMSException {
|
||||
|
||||
@@ -20,10 +20,10 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.MessageConsumer;
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.Connection;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.MessageConsumer;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
import org.springframework.core.Constants;
|
||||
import org.springframework.core.task.SimpleAsyncTaskExecutor;
|
||||
@@ -45,7 +45,7 @@ import org.springframework.util.backoff.FixedBackOff;
|
||||
* Message listener container variant that uses plain JMS client APIs, specifically
|
||||
* a loop of {@code MessageConsumer.receive()} calls that also allow for
|
||||
* transactional reception of messages (registering them with XA transactions).
|
||||
* Designed to work in a native JMS environment as well as in a Java EE environment,
|
||||
* Designed to work in a native JMS environment as well as in a Jakarta EE environment,
|
||||
* with only minimal differences in configuration.
|
||||
*
|
||||
* <p>This is a simple but nevertheless powerful form of message listener container.
|
||||
@@ -62,7 +62,7 @@ import org.springframework.util.backoff.FixedBackOff;
|
||||
* abstraction. By default, the specified number of invoker tasks will be created
|
||||
* on startup, according to the {@link #setConcurrentConsumers "concurrentConsumers"}
|
||||
* setting. Specify an alternative {@code TaskExecutor} to integrate with an existing
|
||||
* thread pool facility (such as a Java EE server's), for example using a
|
||||
* thread pool facility (such as a Jakarta EE server's), for example using a
|
||||
* {@link org.springframework.scheduling.commonj.WorkManagerTaskExecutor CommonJ WorkManager}.
|
||||
* With a native JMS setup, each of those listener threads is going to use a
|
||||
* cached JMS {@code Session} and {@code MessageConsumer} (only refreshed in case
|
||||
@@ -73,11 +73,11 @@ import org.springframework.util.backoff.FixedBackOff;
|
||||
* {@link org.springframework.transaction.PlatformTransactionManager} into the
|
||||
* {@link #setTransactionManager "transactionManager"} property. This will usually
|
||||
* be a {@link org.springframework.transaction.jta.JtaTransactionManager} in a
|
||||
* Java EE environment, in combination with a JTA-aware JMS {@code ConnectionFactory}
|
||||
* obtained from JNDI (check your Java EE server's documentation). Note that this
|
||||
* Jakarta EE environment, in combination with a JTA-aware JMS {@code ConnectionFactory}
|
||||
* obtained from JNDI (check your Jakarta EE server's documentation). Note that this
|
||||
* listener container will automatically reobtain all JMS handles for each transaction
|
||||
* in case an external transaction manager is specified, for compatibility with
|
||||
* all Java EE servers (in particular JBoss). This non-caching behavior can be
|
||||
* all Jakarta EE servers (in particular JBoss). This non-caching behavior can be
|
||||
* overridden through the {@link #setCacheLevel "cacheLevel"} /
|
||||
* {@link #setCacheLevelName "cacheLevelName"} property, enforcing caching of
|
||||
* the {@code Connection} (or also {@code Session} and {@code MessageConsumer})
|
||||
@@ -119,7 +119,7 @@ import org.springframework.util.backoff.FixedBackOff;
|
||||
* @since 2.0
|
||||
* @see #setTransactionManager
|
||||
* @see #setCacheLevel
|
||||
* @see javax.jms.MessageConsumer#receive(long)
|
||||
* @see jakarta.jms.MessageConsumer#receive(long)
|
||||
* @see SimpleMessageListenerContainer
|
||||
* @see org.springframework.jms.listener.endpoint.JmsMessageEndpointManager
|
||||
*/
|
||||
@@ -219,7 +219,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
|
||||
* of concurrent consumers.
|
||||
* <p>Specify an alternative {@code TaskExecutor} for integration with an existing
|
||||
* thread pool. Note that this really only adds value if the threads are
|
||||
* managed in a specific fashion, for example within a Java EE environment.
|
||||
* managed in a specific fashion, for example within a Jakarta EE environment.
|
||||
* A plain thread pool does not add much value, as this listener container
|
||||
* will occupy a number of threads for its entire lifetime.
|
||||
* @see #setConcurrentConsumers
|
||||
@@ -273,7 +273,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
|
||||
* <p>Default is {@link #CACHE_NONE} if an external transaction manager has been specified
|
||||
* (to reobtain all resources freshly within the scope of the external transaction),
|
||||
* and {@link #CACHE_CONSUMER} otherwise (operating with local JMS resources).
|
||||
* <p>Some Java EE servers only register their JMS resources with an ongoing XA
|
||||
* <p>Some Jakarta EE servers only register their JMS resources with an ongoing XA
|
||||
* transaction in case of a freshly obtained JMS {@code Connection} and {@code Session},
|
||||
* which is why this listener container by default does not cache any of those.
|
||||
* However, depending on the rules of your server with respect to the caching
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.jms.listener;
|
||||
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
import org.springframework.jms.connection.JmsResourceHolder;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public interface MessageListenerContainer extends SmartLifecycle {
|
||||
|
||||
/**
|
||||
* Return the {@link MessageConverter} that can be used to
|
||||
* convert {@link javax.jms.Message}, if any.
|
||||
* convert {@link jakarta.jms.Message}, if any.
|
||||
*/
|
||||
@Nullable
|
||||
MessageConverter getMessageConverter();
|
||||
@@ -53,15 +53,15 @@ public interface MessageListenerContainer extends SmartLifecycle {
|
||||
DestinationResolver getDestinationResolver();
|
||||
|
||||
/**
|
||||
* Return whether the Publish/Subscribe domain ({@link javax.jms.Topic Topics}) is used.
|
||||
* Otherwise, the Point-to-Point domain ({@link javax.jms.Queue Queues}) is used.
|
||||
* Return whether the Publish/Subscribe domain ({@link jakarta.jms.Topic Topics}) is used.
|
||||
* Otherwise, the Point-to-Point domain ({@link jakarta.jms.Queue Queues}) is used.
|
||||
*/
|
||||
boolean isPubSubDomain();
|
||||
|
||||
/**
|
||||
* Return whether the reply destination uses Publish/Subscribe domain
|
||||
* ({@link javax.jms.Topic Topics}). Otherwise, the Point-to-Point domain
|
||||
* ({@link javax.jms.Queue Queues}) is used.
|
||||
* ({@link jakarta.jms.Topic Topics}). Otherwise, the Point-to-Point domain
|
||||
* ({@link jakarta.jms.Queue Queues}) is used.
|
||||
* <p>By default, the value is identical to {@link #isPubSubDomain()}.
|
||||
*/
|
||||
boolean isReplyPubSubDomain();
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
|
||||
package org.springframework.jms.listener;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
/**
|
||||
* Variant of the standard JMS {@link javax.jms.MessageListener} interface,
|
||||
* Variant of the standard JMS {@link jakarta.jms.MessageListener} interface,
|
||||
* offering not only the received Message but also the underlying
|
||||
* JMS Session object. The latter can be used to send reply messages,
|
||||
* without the need to access an external Connection/Session,
|
||||
@@ -40,7 +40,7 @@ import javax.jms.Session;
|
||||
* @see DefaultMessageListenerContainer
|
||||
* @see SimpleMessageListenerContainer
|
||||
* @see org.springframework.jms.listener.endpoint.JmsMessageEndpointManager
|
||||
* @see javax.jms.MessageListener
|
||||
* @see jakarta.jms.MessageListener
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface SessionAwareMessageListener<M extends Message> {
|
||||
|
||||
@@ -20,14 +20,14 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import javax.jms.ConnectionFactory;
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.ExceptionListener;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.MessageConsumer;
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.Connection;
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
import jakarta.jms.Destination;
|
||||
import jakarta.jms.ExceptionListener;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.MessageConsumer;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
import org.springframework.jms.support.JmsUtils;
|
||||
import org.springframework.lang.Nullable;
|
||||
@@ -59,7 +59,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 2.0
|
||||
* @see javax.jms.MessageConsumer#setMessageListener
|
||||
* @see jakarta.jms.MessageConsumer#setMessageListener
|
||||
* @see DefaultMessageListenerContainer
|
||||
* @see org.springframework.jms.listener.endpoint.JmsMessageEndpointManager
|
||||
*/
|
||||
@@ -174,7 +174,7 @@ public class SimpleMessageListenerContainer extends AbstractMessageListenerConta
|
||||
* underlying Session.</b> As a consequence, it is not recommended to use
|
||||
* this setting with a {@link SessionAwareMessageListener}, at least not
|
||||
* if the latter performs actual work on the given Session. A standard
|
||||
* {@link javax.jms.MessageListener} will work fine, in general.
|
||||
* {@link jakarta.jms.MessageListener} will work fine, in general.
|
||||
* @see #setConcurrentConsumers
|
||||
* @see org.springframework.core.task.SimpleAsyncTaskExecutor
|
||||
* @see org.springframework.scheduling.commonj.WorkManagerTaskExecutor
|
||||
|
||||
@@ -21,7 +21,7 @@ package org.springframework.jms.listener;
|
||||
* name for a durable subscription that they might be registered with. Otherwise
|
||||
* the listener class name will be used as a default subscription name.
|
||||
*
|
||||
* <p>Applies to {@link javax.jms.MessageListener} objects as well as to
|
||||
* <p>Applies to {@link jakarta.jms.MessageListener} objects as well as to
|
||||
* {@link SessionAwareMessageListener} objects and plain listener methods
|
||||
* (as supported by {@link org.springframework.jms.listener.adapter.MessageListenerAdapter}.
|
||||
*
|
||||
|
||||
@@ -16,15 +16,14 @@
|
||||
|
||||
package org.springframework.jms.listener.adapter;
|
||||
|
||||
import javax.jms.BytesMessage;
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.InvalidDestinationException;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.MessageListener;
|
||||
import javax.jms.MessageProducer;
|
||||
import javax.jms.Session;
|
||||
|
||||
import jakarta.jms.BytesMessage;
|
||||
import jakarta.jms.Destination;
|
||||
import jakarta.jms.InvalidDestinationException;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.MessageListener;
|
||||
import jakarta.jms.MessageProducer;
|
||||
import jakarta.jms.Session;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
@@ -96,7 +95,7 @@ public abstract class AbstractAdaptableMessageListener
|
||||
* "JMSReplyTo" field.
|
||||
* <p>Alternatively, specify a JMS Destination object as "defaultResponseDestination".
|
||||
* @see #setDestinationResolver
|
||||
* @see #setDefaultResponseDestination(javax.jms.Destination)
|
||||
* @see #setDefaultResponseDestination(jakarta.jms.Destination)
|
||||
*/
|
||||
public void setDefaultResponseQueueName(String destinationName) {
|
||||
this.defaultResponseDestination = new DestinationNameHolder(destinationName, false);
|
||||
@@ -108,7 +107,7 @@ public abstract class AbstractAdaptableMessageListener
|
||||
* "JMSReplyTo" field.
|
||||
* <p>Alternatively, specify a JMS Destination object as "defaultResponseDestination".
|
||||
* @see #setDestinationResolver
|
||||
* @see #setDefaultResponseDestination(javax.jms.Destination)
|
||||
* @see #setDefaultResponseDestination(jakarta.jms.Destination)
|
||||
*/
|
||||
public void setDefaultResponseTopicName(String destinationName) {
|
||||
this.defaultResponseDestination = new DestinationNameHolder(destinationName, true);
|
||||
@@ -139,9 +138,9 @@ public abstract class AbstractAdaptableMessageListener
|
||||
* listener method arguments, and objects returned from listener
|
||||
* methods back to JMS messages.
|
||||
* <p>The default converter is a {@link SimpleMessageConverter}, which is able
|
||||
* to handle {@link javax.jms.BytesMessage BytesMessages},
|
||||
* {@link javax.jms.TextMessage TextMessages} and
|
||||
* {@link javax.jms.ObjectMessage ObjectMessages}.
|
||||
* to handle {@link jakarta.jms.BytesMessage BytesMessages},
|
||||
* {@link jakarta.jms.TextMessage TextMessages} and
|
||||
* {@link jakarta.jms.ObjectMessage ObjectMessages}.
|
||||
*/
|
||||
public void setMessageConverter(@Nullable MessageConverter messageConverter) {
|
||||
this.messageConverter = messageConverter;
|
||||
@@ -208,7 +207,7 @@ public abstract class AbstractAdaptableMessageListener
|
||||
* message listener container) for handling result objects as well.
|
||||
* @param message the incoming JMS message
|
||||
* @see #handleListenerException
|
||||
* @see #onMessage(javax.jms.Message, javax.jms.Session)
|
||||
* @see #onMessage(jakarta.jms.Message, jakarta.jms.Session)
|
||||
*/
|
||||
@Override
|
||||
public void onMessage(Message message) {
|
||||
@@ -230,7 +229,7 @@ public abstract class AbstractAdaptableMessageListener
|
||||
* In case of the Spring {@link SessionAwareMessageListener} mechanism,
|
||||
* exceptions get handled by the caller instead.
|
||||
* @param ex the exception to handle
|
||||
* @see #onMessage(javax.jms.Message)
|
||||
* @see #onMessage(jakarta.jms.Message)
|
||||
*/
|
||||
protected void handleListenerException(Throwable ex) {
|
||||
logger.error("Listener execution failed", ex);
|
||||
@@ -343,7 +342,7 @@ public abstract class AbstractAdaptableMessageListener
|
||||
* @param request the original incoming JMS message
|
||||
* @param response the outgoing JMS message about to be sent
|
||||
* @throws JMSException if thrown by JMS API methods
|
||||
* @see javax.jms.Message#setJMSCorrelationID
|
||||
* @see jakarta.jms.Message#setJMSCorrelationID
|
||||
*/
|
||||
protected void postProcessResponse(Message request, Message response) throws JMSException {
|
||||
String correlation = request.getJMSCorrelationID();
|
||||
@@ -373,15 +372,15 @@ public abstract class AbstractAdaptableMessageListener
|
||||
* it is returned; if it is {@code null}, then the configured
|
||||
* {@link #resolveDefaultResponseDestination default response destination}
|
||||
* is returned; if this too is {@code null}, then an
|
||||
* {@link javax.jms.InvalidDestinationException} is thrown.
|
||||
* {@link jakarta.jms.InvalidDestinationException} is thrown.
|
||||
* @param request the original incoming JMS message
|
||||
* @param response the outgoing JMS message about to be sent
|
||||
* @param session the JMS Session to operate on
|
||||
* @return the response destination (never {@code null})
|
||||
* @throws JMSException if thrown by JMS API methods
|
||||
* @throws javax.jms.InvalidDestinationException if no {@link Destination} can be determined
|
||||
* @throws jakarta.jms.InvalidDestinationException if no {@link Destination} can be determined
|
||||
* @see #setDefaultResponseDestination
|
||||
* @see javax.jms.Message#getJMSReplyTo()
|
||||
* @see jakarta.jms.Message#getJMSReplyTo()
|
||||
*/
|
||||
protected Destination getResponseDestination(Message request, Message response, Session session)
|
||||
throws JMSException {
|
||||
@@ -401,7 +400,7 @@ public abstract class AbstractAdaptableMessageListener
|
||||
* Resolve the default response destination into a JMS {@link Destination}, using this
|
||||
* accessor's {@link DestinationResolver} in case of a destination name.
|
||||
* @return the located {@link Destination}
|
||||
* @throws javax.jms.JMSException if resolution failed
|
||||
* @throws jakarta.jms.JMSException if resolution failed
|
||||
* @see #setDefaultResponseDestination
|
||||
* @see #setDefaultResponseQueueName
|
||||
* @see #setDefaultResponseTopicName
|
||||
@@ -426,8 +425,8 @@ public abstract class AbstractAdaptableMessageListener
|
||||
* @param session the JMS session to operate on
|
||||
* @throws JMSException if thrown by JMS API methods
|
||||
* @see #postProcessProducer
|
||||
* @see javax.jms.Session#createProducer
|
||||
* @see javax.jms.MessageProducer#send
|
||||
* @see jakarta.jms.Session#createProducer
|
||||
* @see jakarta.jms.MessageProducer#send
|
||||
*/
|
||||
protected void sendResponse(Session session, Destination destination, Message response) throws JMSException {
|
||||
MessageProducer producer = session.createProducer(destination);
|
||||
@@ -460,13 +459,13 @@ public abstract class AbstractAdaptableMessageListener
|
||||
|
||||
/**
|
||||
* A {@link MessagingMessageConverter} that lazily invokes payload extraction and
|
||||
* delegates it to {@link #extractMessage(javax.jms.Message)} in order to enforce
|
||||
* delegates it to {@link #extractMessage(jakarta.jms.Message)} in order to enforce
|
||||
* backward compatibility.
|
||||
*/
|
||||
private class MessagingMessageConverterAdapter extends MessagingMessageConverter {
|
||||
|
||||
@Override
|
||||
public Object fromMessage(javax.jms.Message message) throws JMSException, MessageConversionException {
|
||||
public Object fromMessage(jakarta.jms.Message message) throws JMSException, MessageConversionException {
|
||||
return new LazyResolutionMessage(message);
|
||||
}
|
||||
|
||||
@@ -505,7 +504,7 @@ public abstract class AbstractAdaptableMessageListener
|
||||
|
||||
protected class LazyResolutionMessage implements org.springframework.messaging.Message<Object> {
|
||||
|
||||
private final javax.jms.Message message;
|
||||
private final jakarta.jms.Message message;
|
||||
|
||||
@Nullable
|
||||
private Object payload;
|
||||
@@ -513,7 +512,7 @@ public abstract class AbstractAdaptableMessageListener
|
||||
@Nullable
|
||||
private MessageHeaders headers;
|
||||
|
||||
public LazyResolutionMessage(javax.jms.Message message) {
|
||||
public LazyResolutionMessage(jakarta.jms.Message message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.jms.listener.adapter;
|
||||
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.Destination;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
import org.springframework.jms.support.destination.DestinationResolver;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
@@ -18,10 +18,10 @@ package org.springframework.jms.listener.adapter;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.MessageListener;
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.MessageListener;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
import org.springframework.jms.listener.SessionAwareMessageListener;
|
||||
import org.springframework.jms.listener.SubscriptionNameProvider;
|
||||
@@ -51,7 +51,7 @@ import org.springframework.util.ObjectUtils;
|
||||
* message content type such as {@code String} or byte array), it will get
|
||||
* wrapped in a JMS {@code Message} and sent to the response destination
|
||||
* (either the JMS "reply-to" destination or a
|
||||
* {@link #setDefaultResponseDestination(javax.jms.Destination) specified default
|
||||
* {@link #setDefaultResponseDestination(jakarta.jms.Destination) specified default
|
||||
* destination}).
|
||||
*
|
||||
* <p><b>Note:</b> The sending of response messages is only available when
|
||||
@@ -86,7 +86,7 @@ import org.springframework.util.ObjectUtils;
|
||||
*
|
||||
* This next example illustrates a {@code Message} delegate
|
||||
* that just consumes the {@code String} contents of
|
||||
* {@link javax.jms.TextMessage TextMessages}. Notice also how the
|
||||
* {@link jakarta.jms.TextMessage TextMessages}. Notice also how the
|
||||
* name of the {@code Message} handling method is different from the
|
||||
* {@link #ORIGINAL_DEFAULT_LISTENER_METHOD original} (this will have to
|
||||
* be configured in the attendant bean definition). Again, no {@code Message}
|
||||
@@ -98,9 +98,9 @@ import org.springframework.util.ObjectUtils;
|
||||
*
|
||||
* This final example illustrates a {@code Message} delegate
|
||||
* that just consumes the {@code String} contents of
|
||||
* {@link javax.jms.TextMessage TextMessages}. Notice how the return type
|
||||
* {@link jakarta.jms.TextMessage TextMessages}. Notice how the return type
|
||||
* of this method is {@code String}: This will result in the configured
|
||||
* {@link MessageListenerAdapter} sending a {@link javax.jms.TextMessage} in response.
|
||||
* {@link MessageListenerAdapter} sending a {@link jakarta.jms.TextMessage} in response.
|
||||
*
|
||||
* <pre class="code">public interface ResponsiveTextMessageContentDelegate {
|
||||
* String handleMessage(String text);
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package org.springframework.jms.listener.adapter;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.jms.support.JmsHeaderMapper;
|
||||
@@ -31,14 +31,14 @@ import org.springframework.messaging.support.MessageBuilder;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* A {@link javax.jms.MessageListener} adapter that invokes a configurable
|
||||
* A {@link jakarta.jms.MessageListener} adapter that invokes a configurable
|
||||
* {@link InvocableHandlerMethod}.
|
||||
*
|
||||
* <p>Wraps the incoming {@link javax.jms.Message} to Spring's {@link Message}
|
||||
* <p>Wraps the incoming {@link jakarta.jms.Message} to Spring's {@link Message}
|
||||
* abstraction, copying the JMS standard headers using a configurable
|
||||
* {@link JmsHeaderMapper}.
|
||||
*
|
||||
* <p>The original {@link javax.jms.Message} and the {@link javax.jms.Session}
|
||||
* <p>The original {@link jakarta.jms.Message} and the {@link jakarta.jms.Session}
|
||||
* are provided as additional arguments so that these can be injected as
|
||||
* method arguments if necessary.
|
||||
*
|
||||
@@ -56,7 +56,7 @@ public class MessagingMessageListenerAdapter extends AbstractAdaptableMessageLis
|
||||
|
||||
/**
|
||||
* Set the {@link InvocableHandlerMethod} to use to invoke the method
|
||||
* processing an incoming {@link javax.jms.Message}.
|
||||
* processing an incoming {@link jakarta.jms.Message}.
|
||||
*/
|
||||
public void setHandlerMethod(InvocableHandlerMethod handlerMethod) {
|
||||
this.handlerMethod = handlerMethod;
|
||||
@@ -69,7 +69,7 @@ public class MessagingMessageListenerAdapter extends AbstractAdaptableMessageLis
|
||||
|
||||
|
||||
@Override
|
||||
public void onMessage(javax.jms.Message jmsMessage, @Nullable Session session) throws JMSException {
|
||||
public void onMessage(jakarta.jms.Message jmsMessage, @Nullable Session session) throws JMSException {
|
||||
Message<?> message = toMessagingMessage(jmsMessage);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Processing [" + message + "]");
|
||||
@@ -94,7 +94,7 @@ public class MessagingMessageListenerAdapter extends AbstractAdaptableMessageLis
|
||||
AbstractMessageSendingTemplate.CONVERSION_HINT_HEADER, returnType).build();
|
||||
}
|
||||
|
||||
protected Message<?> toMessagingMessage(javax.jms.Message jmsMessage) {
|
||||
protected Message<?> toMessagingMessage(jakarta.jms.Message jmsMessage) {
|
||||
try {
|
||||
return (Message<?>) getMessagingMessageConverter().fromMessage(jmsMessage);
|
||||
}
|
||||
@@ -108,7 +108,7 @@ public class MessagingMessageListenerAdapter extends AbstractAdaptableMessageLis
|
||||
* with a dedicated error message.
|
||||
*/
|
||||
@Nullable
|
||||
private Object invokeHandler(javax.jms.Message jmsMessage, @Nullable Session session, Message<?> message) {
|
||||
private Object invokeHandler(jakarta.jms.Message jmsMessage, @Nullable Session session, Message<?> message) {
|
||||
InvocableHandlerMethod handlerMethod = getHandlerMethod();
|
||||
try {
|
||||
return handlerMethod.invoke(message, jmsMessage, session);
|
||||
|
||||
@@ -16,9 +16,8 @@
|
||||
|
||||
package org.springframework.jms.listener.endpoint;
|
||||
|
||||
import javax.jms.Session;
|
||||
import javax.resource.spi.ResourceAdapter;
|
||||
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.resource.spi.ResourceAdapter;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.jms.listener.endpoint;
|
||||
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
import org.springframework.core.Constants;
|
||||
import org.springframework.jms.support.QosSettings;
|
||||
@@ -36,11 +36,11 @@ import org.springframework.lang.Nullable;
|
||||
* @since 2.5
|
||||
* @see JmsActivationSpecFactory
|
||||
* @see JmsMessageEndpointManager#setActivationSpecConfig
|
||||
* @see javax.resource.spi.ResourceAdapter#endpointActivation
|
||||
* @see jakarta.resource.spi.ResourceAdapter#endpointActivation
|
||||
*/
|
||||
public class JmsActivationSpecConfig {
|
||||
|
||||
/** Constants instance for {@code javax.jms.Session}. */
|
||||
/** Constants instance for {@code jakarta.jms.Session}. */
|
||||
private static final Constants sessionConstants = new Constants(Session.class);
|
||||
|
||||
|
||||
@@ -184,10 +184,10 @@ public class JmsActivationSpecConfig {
|
||||
* supports "SESSION_TRANSACTED" in the form of RA-managed transactions
|
||||
* (automatically translated by Spring's {@link DefaultJmsActivationSpecFactory}.
|
||||
* @param constantName the name of the {@link Session} acknowledge mode constant
|
||||
* @see javax.jms.Session#AUTO_ACKNOWLEDGE
|
||||
* @see javax.jms.Session#CLIENT_ACKNOWLEDGE
|
||||
* @see javax.jms.Session#DUPS_OK_ACKNOWLEDGE
|
||||
* @see javax.jms.Session#SESSION_TRANSACTED
|
||||
* @see jakarta.jms.Session#AUTO_ACKNOWLEDGE
|
||||
* @see jakarta.jms.Session#CLIENT_ACKNOWLEDGE
|
||||
* @see jakarta.jms.Session#DUPS_OK_ACKNOWLEDGE
|
||||
* @see jakarta.jms.Session#SESSION_TRANSACTED
|
||||
* @see StandardJmsActivationSpecFactory
|
||||
* @see DefaultJmsActivationSpecFactory
|
||||
*/
|
||||
@@ -197,10 +197,10 @@ public class JmsActivationSpecConfig {
|
||||
|
||||
/**
|
||||
* Set the JMS acknowledgement mode to use.
|
||||
* @see javax.jms.Session#AUTO_ACKNOWLEDGE
|
||||
* @see javax.jms.Session#CLIENT_ACKNOWLEDGE
|
||||
* @see javax.jms.Session#DUPS_OK_ACKNOWLEDGE
|
||||
* @see javax.jms.Session#SESSION_TRANSACTED
|
||||
* @see jakarta.jms.Session#AUTO_ACKNOWLEDGE
|
||||
* @see jakarta.jms.Session#CLIENT_ACKNOWLEDGE
|
||||
* @see jakarta.jms.Session#DUPS_OK_ACKNOWLEDGE
|
||||
* @see jakarta.jms.Session#SESSION_TRANSACTED
|
||||
*/
|
||||
public void setAcknowledgeMode(int acknowledgeMode) {
|
||||
this.acknowledgeMode = acknowledgeMode;
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package org.springframework.jms.listener.endpoint;
|
||||
|
||||
import javax.resource.spi.ActivationSpec;
|
||||
import javax.resource.spi.ResourceAdapter;
|
||||
import jakarta.resource.spi.ActivationSpec;
|
||||
import jakarta.resource.spi.ResourceAdapter;
|
||||
|
||||
/**
|
||||
* Strategy interface for creating JCA 1.5 ActivationSpec objects
|
||||
@@ -32,7 +32,7 @@ import javax.resource.spi.ResourceAdapter;
|
||||
* @since 2.5
|
||||
* @see JmsActivationSpecConfig
|
||||
* @see JmsMessageEndpointManager#setActivationSpecFactory
|
||||
* @see javax.resource.spi.ResourceAdapter#endpointActivation
|
||||
* @see jakarta.resource.spi.ResourceAdapter#endpointActivation
|
||||
*/
|
||||
public interface JmsActivationSpecFactory {
|
||||
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
package org.springframework.jms.listener.endpoint;
|
||||
|
||||
import javax.jms.Message;
|
||||
import javax.jms.MessageListener;
|
||||
import javax.resource.ResourceException;
|
||||
import javax.resource.spi.UnavailableException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.MessageListener;
|
||||
import jakarta.resource.ResourceException;
|
||||
import jakarta.resource.spi.UnavailableException;
|
||||
|
||||
import org.springframework.jca.endpoint.AbstractMessageEndpointFactory;
|
||||
import org.springframework.lang.Nullable;
|
||||
@@ -27,9 +27,9 @@ import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* JMS-specific implementation of the JCA 1.7
|
||||
* {@link javax.resource.spi.endpoint.MessageEndpointFactory} interface,
|
||||
* {@link jakarta.resource.spi.endpoint.MessageEndpointFactory} interface,
|
||||
* providing transaction management capabilities for a JMS listener object
|
||||
* (e.g. a {@link javax.jms.MessageListener} object).
|
||||
* (e.g. a {@link jakarta.jms.MessageListener} object).
|
||||
*
|
||||
* <p>Uses a static endpoint implementation, simply wrapping the
|
||||
* specified message listener object and exposing all of its implemented
|
||||
@@ -38,7 +38,7 @@ import org.springframework.util.Assert;
|
||||
* <p>Typically used with Spring's {@link JmsMessageEndpointManager},
|
||||
* but not tied to it. As a consequence, this endpoint factory could
|
||||
* also be used with programmatic endpoint management on a native
|
||||
* {@link javax.resource.spi.ResourceAdapter} instance.
|
||||
* {@link jakarta.resource.spi.ResourceAdapter} instance.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Stephane Nicoll
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package org.springframework.jms.listener.endpoint;
|
||||
|
||||
import javax.jms.MessageListener;
|
||||
import javax.resource.ResourceException;
|
||||
import jakarta.jms.MessageListener;
|
||||
import jakarta.resource.ResourceException;
|
||||
|
||||
import org.springframework.beans.factory.BeanNameAware;
|
||||
import org.springframework.jca.endpoint.GenericMessageEndpointManager;
|
||||
@@ -37,15 +37,15 @@ import org.springframework.lang.Nullable;
|
||||
* object for activating the endpoint.
|
||||
*
|
||||
* <p><b>NOTE:</b> This JCA-based endpoint manager supports standard JMS
|
||||
* {@link javax.jms.MessageListener} endpoints only. It does <i>not</i> support
|
||||
* {@link jakarta.jms.MessageListener} endpoints only. It does <i>not</i> support
|
||||
* Spring's {@link org.springframework.jms.listener.SessionAwareMessageListener}
|
||||
* variant, simply because the JCA endpoint management contract does not allow
|
||||
* for obtaining the current JMS {@link javax.jms.Session}.
|
||||
* for obtaining the current JMS {@link jakarta.jms.Session}.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Stephane Nicoll
|
||||
* @since 2.5
|
||||
* @see javax.jms.MessageListener
|
||||
* @see jakarta.jms.MessageListener
|
||||
* @see #setActivationSpecConfig
|
||||
* @see JmsActivationSpecConfig
|
||||
* @see JmsActivationSpecFactory
|
||||
@@ -86,7 +86,7 @@ public class JmsMessageEndpointManager extends GenericMessageEndpointManager
|
||||
* invocations, enlisting the endpoint resource in each such transaction.
|
||||
* <p>The passed-in object may be a transaction manager which implements
|
||||
* Spring's {@link org.springframework.transaction.jta.TransactionFactory}
|
||||
* interface, or a plain {@link javax.transaction.TransactionManager}.
|
||||
* interface, or a plain {@link jakarta.transaction.TransactionManager}.
|
||||
* <p>If no transaction manager is specified, the endpoint invocation
|
||||
* will simply not be wrapped in an XA transaction. Consult your
|
||||
* resource provider's ActivationSpec documentation for the local
|
||||
|
||||
@@ -18,12 +18,12 @@ package org.springframework.jms.listener.endpoint;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Queue;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.Topic;
|
||||
import javax.resource.spi.ActivationSpec;
|
||||
import javax.resource.spi.ResourceAdapter;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Queue;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.Topic;
|
||||
import jakarta.resource.spi.ActivationSpec;
|
||||
import jakarta.resource.spi.ResourceAdapter;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.BeanWrapper;
|
||||
@@ -193,11 +193,11 @@ public class StandardJmsActivationSpecFactory implements JmsActivationSpecFactor
|
||||
* having been requested.
|
||||
* @param bw the BeanWrapper wrapping the ActivationSpec object
|
||||
* @param ackMode the configured acknowledge mode
|
||||
* (according to the constants in {@link javax.jms.Session}
|
||||
* @see javax.jms.Session#AUTO_ACKNOWLEDGE
|
||||
* @see javax.jms.Session#DUPS_OK_ACKNOWLEDGE
|
||||
* @see javax.jms.Session#CLIENT_ACKNOWLEDGE
|
||||
* @see javax.jms.Session#SESSION_TRANSACTED
|
||||
* (according to the constants in {@link jakarta.jms.Session}
|
||||
* @see jakarta.jms.Session#AUTO_ACKNOWLEDGE
|
||||
* @see jakarta.jms.Session#DUPS_OK_ACKNOWLEDGE
|
||||
* @see jakarta.jms.Session#CLIENT_ACKNOWLEDGE
|
||||
* @see jakarta.jms.Session#SESSION_TRANSACTED
|
||||
*/
|
||||
protected void applyAcknowledgeMode(BeanWrapper bw, int ackMode) {
|
||||
if (ackMode == Session.SESSION_TRANSACTED) {
|
||||
|
||||
@@ -16,11 +16,10 @@
|
||||
|
||||
package org.springframework.jms.support;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import javax.jms.ConnectionFactory;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Session;
|
||||
|
||||
import jakarta.jms.Connection;
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Session;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
@@ -47,7 +46,7 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public abstract class JmsAccessor implements InitializingBean {
|
||||
|
||||
/** Constants instance for {@code javax.jms.Session}. */
|
||||
/** Constants instance for {@code jakarta.jms.Session}. */
|
||||
private static final Constants sessionConstants = new Constants(Session.class);
|
||||
|
||||
|
||||
@@ -95,7 +94,7 @@ public abstract class JmsAccessor implements InitializingBean {
|
||||
* Default is "false".
|
||||
* <p>Note that within a JTA transaction, the parameters passed to
|
||||
* {@code create(Queue/Topic)Session(boolean transacted, int acknowledgeMode)}
|
||||
* method are not taken into account. Depending on the Java EE transaction context,
|
||||
* method are not taken into account. Depending on the Jakarta EE transaction context,
|
||||
* the container makes its own decisions on these values. Analogously, these
|
||||
* parameters are not taken into account within a locally managed transaction
|
||||
* either, since the accessor operates on an existing JMS Session in this case.
|
||||
@@ -106,7 +105,7 @@ public abstract class JmsAccessor implements InitializingBean {
|
||||
* transaction being managed alongside the main transaction (which might
|
||||
* be a native JDBC transaction), with the JMS transaction committing
|
||||
* right after the main transaction.
|
||||
* @see javax.jms.Connection#createSession(boolean, int)
|
||||
* @see jakarta.jms.Connection#createSession(boolean, int)
|
||||
*/
|
||||
public void setSessionTransacted(boolean sessionTransacted) {
|
||||
this.sessionTransacted = sessionTransacted;
|
||||
@@ -127,10 +126,10 @@ public abstract class JmsAccessor implements InitializingBean {
|
||||
* <p>If you want to use vendor-specific extensions to the acknowledgment mode,
|
||||
* use {@link #setSessionAcknowledgeMode(int)} instead.
|
||||
* @param constantName the name of the {@link Session} acknowledge mode constant
|
||||
* @see javax.jms.Session#AUTO_ACKNOWLEDGE
|
||||
* @see javax.jms.Session#CLIENT_ACKNOWLEDGE
|
||||
* @see javax.jms.Session#DUPS_OK_ACKNOWLEDGE
|
||||
* @see javax.jms.Connection#createSession(boolean, int)
|
||||
* @see jakarta.jms.Session#AUTO_ACKNOWLEDGE
|
||||
* @see jakarta.jms.Session#CLIENT_ACKNOWLEDGE
|
||||
* @see jakarta.jms.Session#DUPS_OK_ACKNOWLEDGE
|
||||
* @see jakarta.jms.Connection#createSession(boolean, int)
|
||||
*/
|
||||
public void setSessionAcknowledgeModeName(String constantName) {
|
||||
setSessionAcknowledgeMode(sessionConstants.asNumber(constantName).intValue());
|
||||
@@ -147,10 +146,10 @@ public abstract class JmsAccessor implements InitializingBean {
|
||||
* the container makes its own decisions on these values. See section 17.3.5
|
||||
* of the EJB spec.
|
||||
* @param sessionAcknowledgeMode the acknowledgement mode constant
|
||||
* @see javax.jms.Session#AUTO_ACKNOWLEDGE
|
||||
* @see javax.jms.Session#CLIENT_ACKNOWLEDGE
|
||||
* @see javax.jms.Session#DUPS_OK_ACKNOWLEDGE
|
||||
* @see javax.jms.Connection#createSession(boolean, int)
|
||||
* @see jakarta.jms.Session#AUTO_ACKNOWLEDGE
|
||||
* @see jakarta.jms.Session#CLIENT_ACKNOWLEDGE
|
||||
* @see jakarta.jms.Session#DUPS_OK_ACKNOWLEDGE
|
||||
* @see jakarta.jms.Connection#createSession(boolean, int)
|
||||
*/
|
||||
public void setSessionAcknowledgeMode(int sessionAcknowledgeMode) {
|
||||
this.sessionAcknowledgeMode = sessionAcknowledgeMode;
|
||||
@@ -172,7 +171,7 @@ public abstract class JmsAccessor implements InitializingBean {
|
||||
|
||||
|
||||
/**
|
||||
* Convert the specified checked {@link javax.jms.JMSException JMSException} to
|
||||
* Convert the specified checked {@link jakarta.jms.JMSException JMSException} to
|
||||
* a Spring runtime {@link org.springframework.jms.JmsException JmsException}
|
||||
* equivalent.
|
||||
* <p>The default implementation delegates to the
|
||||
@@ -190,7 +189,7 @@ public abstract class JmsAccessor implements InitializingBean {
|
||||
* <p>This implementation uses JMS 1.1 API.
|
||||
* @return the new JMS Connection
|
||||
* @throws JMSException if thrown by JMS API methods
|
||||
* @see javax.jms.ConnectionFactory#createConnection()
|
||||
* @see jakarta.jms.ConnectionFactory#createConnection()
|
||||
*/
|
||||
protected Connection createConnection() throws JMSException {
|
||||
return obtainConnectionFactory().createConnection();
|
||||
@@ -202,7 +201,7 @@ public abstract class JmsAccessor implements InitializingBean {
|
||||
* @param con the JMS Connection to create a Session for
|
||||
* @return the new JMS Session
|
||||
* @throws JMSException if thrown by JMS API methods
|
||||
* @see javax.jms.Connection#createSession(boolean, int)
|
||||
* @see jakarta.jms.Connection#createSession(boolean, int)
|
||||
*/
|
||||
protected Session createSession(Connection con) throws JMSException {
|
||||
return con.createSession(isSessionTransacted(), getSessionAcknowledgeMode());
|
||||
@@ -213,9 +212,9 @@ public abstract class JmsAccessor implements InitializingBean {
|
||||
* <p>This implementation uses JMS 1.1 API.
|
||||
* @param session the JMS Session to check
|
||||
* @return whether the given Session is in client acknowledge mode
|
||||
* @throws javax.jms.JMSException if thrown by JMS API methods
|
||||
* @see javax.jms.Session#getAcknowledgeMode()
|
||||
* @see javax.jms.Session#CLIENT_ACKNOWLEDGE
|
||||
* @throws jakarta.jms.JMSException if thrown by JMS API methods
|
||||
* @see jakarta.jms.Session#getAcknowledgeMode()
|
||||
* @see jakarta.jms.Session#CLIENT_ACKNOWLEDGE
|
||||
*/
|
||||
protected boolean isClientAcknowledge(Session session) throws JMSException {
|
||||
return (session.getAcknowledgeMode() == Session.CLIENT_ACKNOWLEDGE);
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
|
||||
package org.springframework.jms.support;
|
||||
|
||||
import javax.jms.Message;
|
||||
import jakarta.jms.Message;
|
||||
|
||||
import org.springframework.messaging.support.HeaderMapper;
|
||||
|
||||
/**
|
||||
* Strategy interface for mapping {@link org.springframework.messaging.Message}
|
||||
* headers to an outbound JMS {@link javax.jms.Message} (e.g. to configure JMS
|
||||
* headers to an outbound JMS {@link jakarta.jms.Message} (e.g. to configure JMS
|
||||
* properties) or extracting messaging header values from an inbound JMS Message.
|
||||
*
|
||||
* @author Mark Fisher
|
||||
|
||||
@@ -37,53 +37,53 @@ public interface JmsHeaders {
|
||||
* Correlation ID for the message. This may be the {@link #MESSAGE_ID} of
|
||||
* the message that this message replies to. It may also be an
|
||||
* application-specific identifier.
|
||||
* @see javax.jms.Message#getJMSCorrelationID()
|
||||
* @see jakarta.jms.Message#getJMSCorrelationID()
|
||||
*/
|
||||
String CORRELATION_ID = PREFIX + "correlationId";
|
||||
|
||||
/**
|
||||
* Name of the destination (topic or queue) of the message.
|
||||
* <p>Read-only value.
|
||||
* @see javax.jms.Message#getJMSDestination()
|
||||
* @see javax.jms.Destination
|
||||
* @see javax.jms.Queue
|
||||
* @see javax.jms.Topic
|
||||
* @see jakarta.jms.Message#getJMSDestination()
|
||||
* @see jakarta.jms.Destination
|
||||
* @see jakarta.jms.Queue
|
||||
* @see jakarta.jms.Topic
|
||||
*/
|
||||
String DESTINATION = PREFIX + "destination";
|
||||
|
||||
/**
|
||||
* Distribution mode.
|
||||
* <p>Read-only value.
|
||||
* @see javax.jms.Message#getJMSDeliveryMode()
|
||||
* @see javax.jms.DeliveryMode
|
||||
* @see jakarta.jms.Message#getJMSDeliveryMode()
|
||||
* @see jakarta.jms.DeliveryMode
|
||||
*/
|
||||
String DELIVERY_MODE = PREFIX + "deliveryMode";
|
||||
|
||||
/**
|
||||
* Message expiration date and time.
|
||||
* <p>Read-only value.
|
||||
* @see javax.jms.Message#getJMSExpiration()
|
||||
* @see jakarta.jms.Message#getJMSExpiration()
|
||||
*/
|
||||
String EXPIRATION = PREFIX + "expiration";
|
||||
|
||||
/**
|
||||
* Unique identifier for a message.
|
||||
* <p>Read-only value.
|
||||
* @see javax.jms.Message#getJMSMessageID()
|
||||
* @see jakarta.jms.Message#getJMSMessageID()
|
||||
*/
|
||||
String MESSAGE_ID = PREFIX + "messageId";
|
||||
|
||||
/**
|
||||
* The message priority level.
|
||||
* <p>Read-only value.
|
||||
* @see javax.jms.Message#getJMSPriority()
|
||||
* @see jakarta.jms.Message#getJMSPriority()
|
||||
*/
|
||||
String PRIORITY = PREFIX + "priority";
|
||||
|
||||
/**
|
||||
* Name of the destination (topic or queue) the message replies should
|
||||
* be sent to.
|
||||
* @see javax.jms.Message#getJMSReplyTo()
|
||||
* @see jakarta.jms.Message#getJMSReplyTo()
|
||||
*/
|
||||
String REPLY_TO = PREFIX + "replyTo";
|
||||
|
||||
@@ -91,21 +91,21 @@ public interface JmsHeaders {
|
||||
* Specify if the message was resent. This occurs when a message
|
||||
* consumer fails to acknowledge the message reception.
|
||||
* <p>Read-only value.
|
||||
* @see javax.jms.Message#getJMSRedelivered()
|
||||
* @see jakarta.jms.Message#getJMSRedelivered()
|
||||
*/
|
||||
String REDELIVERED = PREFIX + "redelivered";
|
||||
|
||||
/**
|
||||
* Message type label. This type is a string value describing the message
|
||||
* in a functional manner.
|
||||
* @see javax.jms.Message#getJMSType()
|
||||
* @see jakarta.jms.Message#getJMSType()
|
||||
*/
|
||||
String TYPE = PREFIX + "type";
|
||||
|
||||
/**
|
||||
* Date and time of the message sending operation.
|
||||
* <p>Read-only value.
|
||||
* @see javax.jms.Message#getJMSTimestamp()
|
||||
* @see jakarta.jms.Message#getJMSTimestamp()
|
||||
*/
|
||||
String TIMESTAMP = PREFIX + "timestamp";
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ package org.springframework.jms.support;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.jms.Destination;
|
||||
import jakarta.jms.Destination;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.messaging.Message;
|
||||
|
||||
@@ -16,14 +16,13 @@
|
||||
|
||||
package org.springframework.jms.support;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.MessageConsumer;
|
||||
import javax.jms.MessageProducer;
|
||||
import javax.jms.QueueBrowser;
|
||||
import javax.jms.QueueRequestor;
|
||||
import javax.jms.Session;
|
||||
|
||||
import jakarta.jms.Connection;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.MessageConsumer;
|
||||
import jakarta.jms.MessageProducer;
|
||||
import jakarta.jms.QueueBrowser;
|
||||
import jakarta.jms.QueueRequestor;
|
||||
import jakarta.jms.Session;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
@@ -85,7 +84,7 @@ public abstract class JmsUtils {
|
||||
con.close();
|
||||
}
|
||||
}
|
||||
catch (javax.jms.IllegalStateException ex) {
|
||||
catch (jakarta.jms.IllegalStateException ex) {
|
||||
logger.debug("Ignoring Connection state exception - assuming already closed: " + ex);
|
||||
}
|
||||
catch (JMSException ex) {
|
||||
@@ -217,7 +216,7 @@ public abstract class JmsUtils {
|
||||
try {
|
||||
session.commit();
|
||||
}
|
||||
catch (javax.jms.TransactionInProgressException | javax.jms.IllegalStateException ex) {
|
||||
catch (jakarta.jms.TransactionInProgressException | jakarta.jms.IllegalStateException ex) {
|
||||
// Ignore -> can only happen in case of a JTA transaction.
|
||||
}
|
||||
}
|
||||
@@ -232,7 +231,7 @@ public abstract class JmsUtils {
|
||||
try {
|
||||
session.rollback();
|
||||
}
|
||||
catch (javax.jms.TransactionInProgressException | javax.jms.IllegalStateException ex) {
|
||||
catch (jakarta.jms.TransactionInProgressException | jakarta.jms.IllegalStateException ex) {
|
||||
// Ignore -> can only happen in case of a JTA transaction.
|
||||
}
|
||||
}
|
||||
@@ -242,7 +241,7 @@ public abstract class JmsUtils {
|
||||
* incorporating a linked exception's message if appropriate.
|
||||
* @param ex the JMSException to build a message for
|
||||
* @return the descriptive message String
|
||||
* @see javax.jms.JMSException#getLinkedException()
|
||||
* @see jakarta.jms.JMSException#getLinkedException()
|
||||
*/
|
||||
public static String buildExceptionMessage(JMSException ex) {
|
||||
String message = ex.getMessage();
|
||||
@@ -262,7 +261,7 @@ public abstract class JmsUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the specified checked {@link javax.jms.JMSException JMSException} to a
|
||||
* Convert the specified checked {@link jakarta.jms.JMSException JMSException} to a
|
||||
* Spring runtime {@link org.springframework.jms.JmsException JmsException} equivalent.
|
||||
* @param ex the original checked JMSException to convert
|
||||
* @return the Spring runtime JmsException wrapping the given exception
|
||||
@@ -270,41 +269,41 @@ public abstract class JmsUtils {
|
||||
public static JmsException convertJmsAccessException(JMSException ex) {
|
||||
Assert.notNull(ex, "JMSException must not be null");
|
||||
|
||||
if (ex instanceof javax.jms.IllegalStateException) {
|
||||
return new org.springframework.jms.IllegalStateException((javax.jms.IllegalStateException) ex);
|
||||
if (ex instanceof jakarta.jms.IllegalStateException) {
|
||||
return new org.springframework.jms.IllegalStateException((jakarta.jms.IllegalStateException) ex);
|
||||
}
|
||||
if (ex instanceof javax.jms.InvalidClientIDException) {
|
||||
return new InvalidClientIDException((javax.jms.InvalidClientIDException) ex);
|
||||
if (ex instanceof jakarta.jms.InvalidClientIDException) {
|
||||
return new InvalidClientIDException((jakarta.jms.InvalidClientIDException) ex);
|
||||
}
|
||||
if (ex instanceof javax.jms.InvalidDestinationException) {
|
||||
return new InvalidDestinationException((javax.jms.InvalidDestinationException) ex);
|
||||
if (ex instanceof jakarta.jms.InvalidDestinationException) {
|
||||
return new InvalidDestinationException((jakarta.jms.InvalidDestinationException) ex);
|
||||
}
|
||||
if (ex instanceof javax.jms.InvalidSelectorException) {
|
||||
return new InvalidSelectorException((javax.jms.InvalidSelectorException) ex);
|
||||
if (ex instanceof jakarta.jms.InvalidSelectorException) {
|
||||
return new InvalidSelectorException((jakarta.jms.InvalidSelectorException) ex);
|
||||
}
|
||||
if (ex instanceof javax.jms.JMSSecurityException) {
|
||||
return new JmsSecurityException((javax.jms.JMSSecurityException) ex);
|
||||
if (ex instanceof jakarta.jms.JMSSecurityException) {
|
||||
return new JmsSecurityException((jakarta.jms.JMSSecurityException) ex);
|
||||
}
|
||||
if (ex instanceof javax.jms.MessageEOFException) {
|
||||
return new MessageEOFException((javax.jms.MessageEOFException) ex);
|
||||
if (ex instanceof jakarta.jms.MessageEOFException) {
|
||||
return new MessageEOFException((jakarta.jms.MessageEOFException) ex);
|
||||
}
|
||||
if (ex instanceof javax.jms.MessageFormatException) {
|
||||
return new MessageFormatException((javax.jms.MessageFormatException) ex);
|
||||
if (ex instanceof jakarta.jms.MessageFormatException) {
|
||||
return new MessageFormatException((jakarta.jms.MessageFormatException) ex);
|
||||
}
|
||||
if (ex instanceof javax.jms.MessageNotReadableException) {
|
||||
return new MessageNotReadableException((javax.jms.MessageNotReadableException) ex);
|
||||
if (ex instanceof jakarta.jms.MessageNotReadableException) {
|
||||
return new MessageNotReadableException((jakarta.jms.MessageNotReadableException) ex);
|
||||
}
|
||||
if (ex instanceof javax.jms.MessageNotWriteableException) {
|
||||
return new MessageNotWriteableException((javax.jms.MessageNotWriteableException) ex);
|
||||
if (ex instanceof jakarta.jms.MessageNotWriteableException) {
|
||||
return new MessageNotWriteableException((jakarta.jms.MessageNotWriteableException) ex);
|
||||
}
|
||||
if (ex instanceof javax.jms.ResourceAllocationException) {
|
||||
return new ResourceAllocationException((javax.jms.ResourceAllocationException) ex);
|
||||
if (ex instanceof jakarta.jms.ResourceAllocationException) {
|
||||
return new ResourceAllocationException((jakarta.jms.ResourceAllocationException) ex);
|
||||
}
|
||||
if (ex instanceof javax.jms.TransactionInProgressException) {
|
||||
return new TransactionInProgressException((javax.jms.TransactionInProgressException) ex);
|
||||
if (ex instanceof jakarta.jms.TransactionInProgressException) {
|
||||
return new TransactionInProgressException((jakarta.jms.TransactionInProgressException) ex);
|
||||
}
|
||||
if (ex instanceof javax.jms.TransactionRolledBackException) {
|
||||
return new TransactionRolledBackException((javax.jms.TransactionRolledBackException) ex);
|
||||
if (ex instanceof jakarta.jms.TransactionRolledBackException) {
|
||||
return new TransactionRolledBackException((jakarta.jms.TransactionRolledBackException) ex);
|
||||
}
|
||||
|
||||
// fallback
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.jms.support;
|
||||
|
||||
import javax.jms.Message;
|
||||
import jakarta.jms.Message;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
@@ -59,10 +59,10 @@ public class QosSettings {
|
||||
* Set the delivery mode to use when sending a message.
|
||||
* Default is the JMS Message default: "PERSISTENT".
|
||||
* @param deliveryMode the delivery mode to use
|
||||
* @see javax.jms.DeliveryMode#PERSISTENT
|
||||
* @see javax.jms.DeliveryMode#NON_PERSISTENT
|
||||
* @see javax.jms.Message#DEFAULT_DELIVERY_MODE
|
||||
* @see javax.jms.MessageProducer#send(javax.jms.Message, int, int, long)
|
||||
* @see jakarta.jms.DeliveryMode#PERSISTENT
|
||||
* @see jakarta.jms.DeliveryMode#NON_PERSISTENT
|
||||
* @see jakarta.jms.Message#DEFAULT_DELIVERY_MODE
|
||||
* @see jakarta.jms.MessageProducer#send(jakarta.jms.Message, int, int, long)
|
||||
*/
|
||||
public void setDeliveryMode(int deliveryMode) {
|
||||
this.deliveryMode = deliveryMode;
|
||||
@@ -77,8 +77,8 @@ public class QosSettings {
|
||||
|
||||
/**
|
||||
* Set the priority of a message when sending.
|
||||
* @see javax.jms.Message#DEFAULT_PRIORITY
|
||||
* @see javax.jms.MessageProducer#send(javax.jms.Message, int, int, long)
|
||||
* @see jakarta.jms.Message#DEFAULT_PRIORITY
|
||||
* @see jakarta.jms.MessageProducer#send(jakarta.jms.Message, int, int, long)
|
||||
*/
|
||||
public void setPriority(int priority) {
|
||||
this.priority = priority;
|
||||
@@ -94,8 +94,8 @@ public class QosSettings {
|
||||
/**
|
||||
* Set the time-to-live of the message when sending.
|
||||
* @param timeToLive the message's lifetime (in milliseconds)
|
||||
* @see javax.jms.Message#DEFAULT_TIME_TO_LIVE
|
||||
* @see javax.jms.MessageProducer#send(javax.jms.Message, int, int, long)
|
||||
* @see jakarta.jms.Message#DEFAULT_TIME_TO_LIVE
|
||||
* @see jakarta.jms.MessageProducer#send(jakarta.jms.Message, int, int, long)
|
||||
*/
|
||||
public void setTimeToLive(long timeToLive) {
|
||||
this.timeToLive = timeToLive;
|
||||
|
||||
@@ -23,9 +23,9 @@ import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import jakarta.jms.Destination;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
|
||||
import org.springframework.messaging.MessageHeaders;
|
||||
import org.springframework.messaging.support.AbstractHeaderMapper;
|
||||
@@ -61,7 +61,7 @@ public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> impleme
|
||||
|
||||
|
||||
@Override
|
||||
public void fromHeaders(MessageHeaders headers, javax.jms.Message jmsMessage) {
|
||||
public void fromHeaders(MessageHeaders headers, jakarta.jms.Message jmsMessage) {
|
||||
try {
|
||||
Object jmsCorrelationId = headers.get(JmsHeaders.CORRELATION_ID);
|
||||
if (jmsCorrelationId instanceof Number) {
|
||||
@@ -125,7 +125,7 @@ public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageHeaders toHeaders(javax.jms.Message jmsMessage) {
|
||||
public MessageHeaders toHeaders(jakarta.jms.Message jmsMessage) {
|
||||
Map<String, Object> headers = new HashMap<>();
|
||||
try {
|
||||
try {
|
||||
|
||||
@@ -24,18 +24,17 @@ import java.io.UnsupportedEncodingException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.jms.BytesMessage;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.TextMessage;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonView;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.JavaType;
|
||||
import com.fasterxml.jackson.databind.MapperFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.ObjectWriter;
|
||||
import jakarta.jms.BytesMessage;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.TextMessage;
|
||||
|
||||
import org.springframework.beans.factory.BeanClassLoaderAware;
|
||||
import org.springframework.core.MethodParameter;
|
||||
@@ -212,7 +211,7 @@ public class MappingJackson2MessageConverter implements SmartMessageConverter, B
|
||||
* @param session the Session to use for creating a JMS Message
|
||||
* @param jsonView the view to use to filter the content
|
||||
* @return the JMS Message
|
||||
* @throws javax.jms.JMSException if thrown by JMS API methods
|
||||
* @throws jakarta.jms.JMSException if thrown by JMS API methods
|
||||
* @throws MessageConversionException in case of conversion failure
|
||||
* @since 4.3
|
||||
*/
|
||||
@@ -343,7 +342,7 @@ public class MappingJackson2MessageConverter implements SmartMessageConverter, B
|
||||
* @param object the payload object to set a type id for
|
||||
* @param message the JMS Message on which to set the type id property
|
||||
* @throws JMSException if thrown by JMS methods
|
||||
* @see #getJavaTypeForMessage(javax.jms.Message)
|
||||
* @see #getJavaTypeForMessage(jakarta.jms.Message)
|
||||
* @see #setTypeIdPropertyName(String)
|
||||
* @see #setTypeIdMappings(java.util.Map)
|
||||
*/
|
||||
@@ -445,7 +444,7 @@ public class MappingJackson2MessageConverter implements SmartMessageConverter, B
|
||||
* a different strategy, e.g. doing some heuristics based on message origin.
|
||||
* @param message the JMS Message from which to get the type id property
|
||||
* @throws JMSException if thrown by JMS methods
|
||||
* @see #setTypeIdOnMessage(Object, javax.jms.Message)
|
||||
* @see #setTypeIdOnMessage(Object, jakarta.jms.Message)
|
||||
* @see #setTypeIdPropertyName(String)
|
||||
* @see #setTypeIdMappings(java.util.Map)
|
||||
*/
|
||||
|
||||
@@ -22,16 +22,17 @@ import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
|
||||
import javax.jms.BytesMessage;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.TextMessage;
|
||||
import javax.xml.transform.Result;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import jakarta.jms.BytesMessage;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.TextMessage;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.oxm.Marshaller;
|
||||
@@ -144,8 +145,8 @@ public class MarshallingMessageConverter implements MessageConverter, Initializi
|
||||
|
||||
|
||||
/**
|
||||
* This implementation marshals the given object to a {@link javax.jms.TextMessage} or
|
||||
* {@link javax.jms.BytesMessage}. The desired message type can be defined by setting
|
||||
* This implementation marshals the given object to a {@link jakarta.jms.TextMessage} or
|
||||
* {@link jakarta.jms.BytesMessage}. The desired message type can be defined by setting
|
||||
* the {@link #setTargetType "marshalTo"} property.
|
||||
* @see #marshalToTextMessage
|
||||
* @see #marshalToBytesMessage
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* Thrown by {@link MessageConverter} implementations when the conversion
|
||||
* of an object to/from a {@link javax.jms.Message} fails.
|
||||
* of an object to/from a {@link jakarta.jms.Message} fails.
|
||||
*
|
||||
* @author Mark Pollack
|
||||
* @since 1.1
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.jms.support.converter;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
/**
|
||||
* Strategy interface that specifies a converter between Java objects and JMS messages.
|
||||
@@ -42,7 +42,7 @@ public interface MessageConverter {
|
||||
* @param object the object to convert
|
||||
* @param session the Session to use for creating a JMS Message
|
||||
* @return the JMS Message
|
||||
* @throws javax.jms.JMSException if thrown by JMS API methods
|
||||
* @throws jakarta.jms.JMSException if thrown by JMS API methods
|
||||
* @throws MessageConversionException in case of conversion failure
|
||||
*/
|
||||
Message toMessage(Object object, Session session) throws JMSException, MessageConversionException;
|
||||
@@ -51,7 +51,7 @@ public interface MessageConverter {
|
||||
* Convert from a JMS Message to a Java object.
|
||||
* @param message the message to convert
|
||||
* @return the converted Java object
|
||||
* @throws javax.jms.JMSException if thrown by JMS API methods
|
||||
* @throws jakarta.jms.JMSException if thrown by JMS API methods
|
||||
* @throws MessageConversionException in case of conversion failure
|
||||
*/
|
||||
Object fromMessage(Message message) throws JMSException, MessageConversionException;
|
||||
|
||||
@@ -18,8 +18,8 @@ package org.springframework.jms.support.converter;
|
||||
|
||||
/**
|
||||
* Constants that indicate a target message type to convert to: a
|
||||
* {@link javax.jms.TextMessage}, a {@link javax.jms.BytesMessage},
|
||||
* a {@link javax.jms.MapMessage} or an {@link javax.jms.ObjectMessage}.
|
||||
* {@link jakarta.jms.TextMessage}, a {@link jakarta.jms.BytesMessage},
|
||||
* a {@link jakarta.jms.MapMessage} or an {@link jakarta.jms.ObjectMessage}.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
@@ -28,22 +28,22 @@ package org.springframework.jms.support.converter;
|
||||
public enum MessageType {
|
||||
|
||||
/**
|
||||
* A {@link javax.jms.TextMessage}.
|
||||
* A {@link jakarta.jms.TextMessage}.
|
||||
*/
|
||||
TEXT,
|
||||
|
||||
/**
|
||||
* A {@link javax.jms.BytesMessage}.
|
||||
* A {@link jakarta.jms.BytesMessage}.
|
||||
*/
|
||||
BYTES,
|
||||
|
||||
/**
|
||||
* A {@link javax.jms.MapMessage}.
|
||||
* A {@link jakarta.jms.MapMessage}.
|
||||
*/
|
||||
MAP,
|
||||
|
||||
/**
|
||||
* A {@link javax.jms.ObjectMessage}.
|
||||
* A {@link jakarta.jms.ObjectMessage}.
|
||||
*/
|
||||
OBJECT
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ package org.springframework.jms.support.converter;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.jms.support.JmsHeaderMapper;
|
||||
@@ -33,7 +33,7 @@ import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Convert a {@link Message} from the messaging abstraction to and from a
|
||||
* {@link javax.jms.Message} using an underlying {@link MessageConverter}
|
||||
* {@link jakarta.jms.Message} using an underlying {@link MessageConverter}
|
||||
* for the payload and a {@link org.springframework.jms.support.JmsHeaderMapper}
|
||||
* to map the JMS headers to and from standard message headers.
|
||||
*
|
||||
@@ -100,7 +100,7 @@ public class MessagingMessageConverter implements MessageConverter, Initializing
|
||||
|
||||
|
||||
@Override
|
||||
public javax.jms.Message toMessage(Object object, Session session) throws JMSException, MessageConversionException {
|
||||
public jakarta.jms.Message toMessage(Object object, Session session) throws JMSException, MessageConversionException {
|
||||
if (!(object instanceof Message)) {
|
||||
throw new IllegalArgumentException("Could not convert [" + object + "] - only [" +
|
||||
Message.class.getName() + "] is handled by this converter");
|
||||
@@ -108,14 +108,14 @@ public class MessagingMessageConverter implements MessageConverter, Initializing
|
||||
Message<?> input = (Message<?>) object;
|
||||
MessageHeaders headers = input.getHeaders();
|
||||
Object conversionHint = headers.get(AbstractMessagingTemplate.CONVERSION_HINT_HEADER);
|
||||
javax.jms.Message reply = createMessageForPayload(input.getPayload(), session, conversionHint);
|
||||
jakarta.jms.Message reply = createMessageForPayload(input.getPayload(), session, conversionHint);
|
||||
this.headerMapper.fromHeaders(headers, reply);
|
||||
return reply;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Object fromMessage(javax.jms.Message message) throws JMSException, MessageConversionException {
|
||||
public Object fromMessage(jakarta.jms.Message message) throws JMSException, MessageConversionException {
|
||||
Map<String, Object> mappedHeaders = extractHeaders(message);
|
||||
Object convertedObject = extractPayload(message);
|
||||
MessageBuilder<Object> builder = (convertedObject instanceof org.springframework.messaging.Message ?
|
||||
@@ -125,9 +125,9 @@ public class MessagingMessageConverter implements MessageConverter, Initializing
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract the payload of the specified {@link javax.jms.Message}.
|
||||
* Extract the payload of the specified {@link jakarta.jms.Message}.
|
||||
*/
|
||||
protected Object extractPayload(javax.jms.Message message) throws JMSException {
|
||||
protected Object extractPayload(jakarta.jms.Message message) throws JMSException {
|
||||
return this.payloadConverter.fromMessage(message);
|
||||
}
|
||||
|
||||
@@ -138,13 +138,13 @@ public class MessagingMessageConverter implements MessageConverter, Initializing
|
||||
* @since 4.3
|
||||
* @see MessageConverter#toMessage(Object, Session)
|
||||
*/
|
||||
protected javax.jms.Message createMessageForPayload(
|
||||
protected jakarta.jms.Message createMessageForPayload(
|
||||
Object payload, Session session, @Nullable Object conversionHint) throws JMSException {
|
||||
|
||||
return this.payloadConverter.toMessage(payload, session);
|
||||
}
|
||||
|
||||
protected final MessageHeaders extractHeaders(javax.jms.Message message) {
|
||||
protected final MessageHeaders extractHeaders(jakarta.jms.Message message) {
|
||||
return this.headerMapper.toHeaders(message);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,13 +21,13 @@ import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.jms.BytesMessage;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.MapMessage;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.ObjectMessage;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.TextMessage;
|
||||
import jakarta.jms.BytesMessage;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.MapMessage;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.ObjectMessage;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.TextMessage;
|
||||
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
@@ -37,9 +37,9 @@ import org.springframework.util.ObjectUtils;
|
||||
* by {@link org.springframework.jms.core.JmsTemplate}, for
|
||||
* {@code convertAndSend} and {@code receiveAndConvert} operations.
|
||||
*
|
||||
* <p>Converts a String to a {@link javax.jms.TextMessage}, a byte array to a
|
||||
* {@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).
|
||||
* <p>Converts a String to a {@link jakarta.jms.TextMessage}, a byte array to a
|
||||
* {@link jakarta.jms.BytesMessage}, a Map to a {@link jakarta.jms.MapMessage}, and
|
||||
* a Serializable object to a {@link jakarta.jms.ObjectMessage} (or vice versa).
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 1.1
|
||||
@@ -117,7 +117,7 @@ public class SimpleMessageConverter implements MessageConverter {
|
||||
* @param session current JMS session
|
||||
* @return the resulting message
|
||||
* @throws JMSException if thrown by JMS methods
|
||||
* @see javax.jms.Session#createTextMessage
|
||||
* @see jakarta.jms.Session#createTextMessage
|
||||
*/
|
||||
protected TextMessage createMessageForString(String text, Session session) throws JMSException {
|
||||
return session.createTextMessage(text);
|
||||
@@ -129,7 +129,7 @@ public class SimpleMessageConverter implements MessageConverter {
|
||||
* @param session current JMS session
|
||||
* @return the resulting message
|
||||
* @throws JMSException if thrown by JMS methods
|
||||
* @see javax.jms.Session#createBytesMessage
|
||||
* @see jakarta.jms.Session#createBytesMessage
|
||||
*/
|
||||
protected BytesMessage createMessageForByteArray(byte[] bytes, Session session) throws JMSException {
|
||||
BytesMessage message = session.createBytesMessage();
|
||||
@@ -143,7 +143,7 @@ public class SimpleMessageConverter implements MessageConverter {
|
||||
* @param session current JMS session
|
||||
* @return the resulting message
|
||||
* @throws JMSException if thrown by JMS methods
|
||||
* @see javax.jms.Session#createMapMessage
|
||||
* @see jakarta.jms.Session#createMapMessage
|
||||
*/
|
||||
protected MapMessage createMessageForMap(Map<?, ?> map, Session session) throws JMSException {
|
||||
MapMessage message = session.createMapMessage();
|
||||
@@ -164,7 +164,7 @@ public class SimpleMessageConverter implements MessageConverter {
|
||||
* @param session current JMS session
|
||||
* @return the resulting message
|
||||
* @throws JMSException if thrown by JMS methods
|
||||
* @see javax.jms.Session#createObjectMessage
|
||||
* @see jakarta.jms.Session#createObjectMessage
|
||||
*/
|
||||
protected ObjectMessage createMessageForSerializable(Serializable object, Session session) throws JMSException {
|
||||
return session.createObjectMessage(object);
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.jms.support.converter;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
@@ -43,7 +43,7 @@ public interface SmartMessageConverter extends MessageConverter {
|
||||
* @param conversionHint an extra object passed to the {@link MessageConverter},
|
||||
* e.g. the associated {@code MethodParameter} (may be {@code null}}
|
||||
* @return the JMS Message
|
||||
* @throws javax.jms.JMSException if thrown by JMS API methods
|
||||
* @throws jakarta.jms.JMSException if thrown by JMS API methods
|
||||
* @throws MessageConversionException in case of conversion failure
|
||||
* @see #toMessage(Object, Session)
|
||||
*/
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.jms.support.destination;
|
||||
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.Destination;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
@@ -30,7 +30,7 @@ import org.springframework.util.Assert;
|
||||
* {@link DestinationResolver} implementation based on a Spring {@link BeanFactory}.
|
||||
*
|
||||
* <p>Will lookup Spring managed beans identified by bean name,
|
||||
* expecting them to be of type {@code javax.jms.Destination}.
|
||||
* expecting them to be of type {@code jakarta.jms.Destination}.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 2.5
|
||||
@@ -57,7 +57,7 @@ public class BeanFactoryDestinationResolver implements DestinationResolver, Bean
|
||||
* replaced by the {@link BeanFactory} that creates it (c.f. the
|
||||
* {@link BeanFactoryAware} contract). So only use this constructor if you
|
||||
* are using this class outside the context of a Spring IoC container.
|
||||
* @param beanFactory the bean factory to be used to lookup {@link javax.jms.Destination Destination}
|
||||
* @param beanFactory the bean factory to be used to lookup {@link jakarta.jms.Destination Destination}
|
||||
*/
|
||||
public BeanFactoryDestinationResolver(BeanFactory beanFactory) {
|
||||
Assert.notNull(beanFactory, "BeanFactory is required");
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.jms.support.destination;
|
||||
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.Destination;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
@@ -51,7 +51,7 @@ public interface DestinationResolver {
|
||||
* @param destinationName the name of the destination
|
||||
* @param pubSubDomain {@code true} if the domain is pub-sub, {@code false} if P2P
|
||||
* @return the JMS destination (either a topic or a queue)
|
||||
* @throws javax.jms.JMSException if the JMS Session failed to resolve the destination
|
||||
* @throws jakarta.jms.JMSException if the JMS Session failed to resolve the destination
|
||||
* @throws DestinationResolutionException in case of general destination resolution failure
|
||||
*/
|
||||
Destination resolveDestinationName(@Nullable Session session, String destinationName, boolean pubSubDomain)
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
package org.springframework.jms.support.destination;
|
||||
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Queue;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.Topic;
|
||||
import jakarta.jms.Destination;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Queue;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.Topic;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -31,8 +31,8 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 1.1
|
||||
* @see javax.jms.Session#createQueue
|
||||
* @see javax.jms.Session#createTopic
|
||||
* @see jakarta.jms.Session#createQueue
|
||||
* @see jakarta.jms.Session#createTopic
|
||||
*/
|
||||
public class DynamicDestinationResolver implements DestinationResolver {
|
||||
|
||||
@@ -42,9 +42,9 @@ public class DynamicDestinationResolver implements DestinationResolver {
|
||||
* @param destinationName the name of the destination
|
||||
* @param pubSubDomain {@code true} if the domain is pub-sub, {@code false} if P2P
|
||||
* @return the JMS destination (either a topic or a queue)
|
||||
* @throws javax.jms.JMSException if resolution failed
|
||||
* @see #resolveTopic(javax.jms.Session, String)
|
||||
* @see #resolveQueue(javax.jms.Session, String)
|
||||
* @throws jakarta.jms.JMSException if resolution failed
|
||||
* @see #resolveTopic(jakarta.jms.Session, String)
|
||||
* @see #resolveQueue(jakarta.jms.Session, String)
|
||||
*/
|
||||
@Override
|
||||
public Destination resolveDestinationName(@Nullable Session session, String destinationName, boolean pubSubDomain)
|
||||
@@ -66,7 +66,7 @@ public class DynamicDestinationResolver implements DestinationResolver {
|
||||
* @param session the current JMS Session
|
||||
* @param topicName the name of the desired {@link Topic}
|
||||
* @return the JMS {@link Topic}
|
||||
* @throws javax.jms.JMSException if resolution failed
|
||||
* @throws jakarta.jms.JMSException if resolution failed
|
||||
* @see Session#createTopic(String)
|
||||
*/
|
||||
protected Topic resolveTopic(Session session, String topicName) throws JMSException {
|
||||
@@ -78,7 +78,7 @@ public class DynamicDestinationResolver implements DestinationResolver {
|
||||
* @param session the current JMS Session
|
||||
* @param queueName the name of the desired {@link Queue}
|
||||
* @return the JMS {@link Queue}
|
||||
* @throws javax.jms.JMSException if resolution failed
|
||||
* @throws jakarta.jms.JMSException if resolution failed
|
||||
* @see Session#createQueue(String)
|
||||
*/
|
||||
protected Queue resolveQueue(Session session, String queueName) throws JMSException {
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
package org.springframework.jms.support.destination;
|
||||
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.MessageConsumer;
|
||||
import javax.jms.Session;
|
||||
import jakarta.jms.Destination;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.MessageConsumer;
|
||||
import jakarta.jms.Session;
|
||||
|
||||
import org.springframework.jms.support.JmsAccessor;
|
||||
import org.springframework.lang.Nullable;
|
||||
@@ -62,7 +62,7 @@ public abstract class JmsDestinationAccessor extends JmsAccessor {
|
||||
|
||||
/**
|
||||
* Set the {@link DestinationResolver} that is to be used to resolve
|
||||
* {@link javax.jms.Destination} references for this accessor.
|
||||
* {@link jakarta.jms.Destination} references for this accessor.
|
||||
* <p>The default resolver is a DynamicDestinationResolver. Specify a
|
||||
* JndiDestinationResolver for resolving destination names as JNDI locations.
|
||||
* @see org.springframework.jms.support.destination.DynamicDestinationResolver
|
||||
@@ -85,8 +85,8 @@ public abstract class JmsDestinationAccessor extends JmsAccessor {
|
||||
* Default is Point-to-Point (Queues).
|
||||
* <p>This setting primarily indicates what type of destination to resolve
|
||||
* if dynamic destinations are enabled.
|
||||
* @param pubSubDomain "true" for the Publish/Subscribe domain ({@link javax.jms.Topic Topics}),
|
||||
* "false" for the Point-to-Point domain ({@link javax.jms.Queue Queues})
|
||||
* @param pubSubDomain "true" for the Publish/Subscribe domain ({@link jakarta.jms.Topic Topics}),
|
||||
* "false" for the Point-to-Point domain ({@link jakarta.jms.Queue Queues})
|
||||
* @see #setDestinationResolver
|
||||
*/
|
||||
public void setPubSubDomain(boolean pubSubDomain) {
|
||||
@@ -94,8 +94,8 @@ public abstract class JmsDestinationAccessor extends JmsAccessor {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether the Publish/Subscribe domain ({@link javax.jms.Topic Topics}) is used.
|
||||
* Otherwise, the Point-to-Point domain ({@link javax.jms.Queue Queues}) is used.
|
||||
* Return whether the Publish/Subscribe domain ({@link jakarta.jms.Topic Topics}) is used.
|
||||
* Otherwise, the Point-to-Point domain ({@link jakarta.jms.Queue Queues}) is used.
|
||||
*/
|
||||
public boolean isPubSubDomain() {
|
||||
return this.pubSubDomain;
|
||||
@@ -108,7 +108,7 @@ public abstract class JmsDestinationAccessor extends JmsAccessor {
|
||||
* @param session the current JMS {@link Session}
|
||||
* @param destinationName the name of the destination
|
||||
* @return the located {@link Destination}
|
||||
* @throws javax.jms.JMSException if resolution failed
|
||||
* @throws jakarta.jms.JMSException if resolution failed
|
||||
* @see #setDestinationResolver
|
||||
*/
|
||||
protected Destination resolveDestinationName(Session session, String destinationName) throws JMSException {
|
||||
|
||||
@@ -19,13 +19,14 @@ package org.springframework.jms.support.destination;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Queue;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.Topic;
|
||||
import javax.naming.NamingException;
|
||||
|
||||
import jakarta.jms.Destination;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Queue;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.Topic;
|
||||
|
||||
import org.springframework.jndi.JndiLocatorSupport;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
]]></xsd:documentation>
|
||||
<xsd:appinfo>
|
||||
<tool:annotation kind="ref">
|
||||
<tool:expected-type type="javax.jms.ConnectionFactory"/>
|
||||
<tool:expected-type type="jakarta.jms.ConnectionFactory"/>
|
||||
</tool:annotation>
|
||||
</xsd:appinfo>
|
||||
</xsd:annotation>
|
||||
@@ -178,7 +178,7 @@
|
||||
A reference to the DestinationResolver strategy for resolving destination names.
|
||||
Default is a DynamicDestinationResolver, using the JMS provider's queue/topic
|
||||
name resolution. Alternatively, specify a reference to a JndiDestinationResolver
|
||||
(typically in a Java EE environment).
|
||||
(typically in a Jakarta EE environment).
|
||||
]]></xsd:documentation>
|
||||
<xsd:appinfo>
|
||||
<tool:annotation kind="ref">
|
||||
@@ -260,7 +260,7 @@
|
||||
The cache level for JMS resources: "none", "connection", "session", "consumer"
|
||||
or "auto". By default ("auto"), the cache level will effectively be "consumer",
|
||||
unless an external transaction manager has been specified - in which case the
|
||||
effective default will be "none" (assuming Java EE-style transaction management
|
||||
effective default will be "none" (assuming Jakarta EE-style transaction management
|
||||
where the given ConnectionFactory is an XA-aware pool).
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
@@ -411,7 +411,7 @@
|
||||
]]></xsd:documentation>
|
||||
<xsd:appinfo>
|
||||
<tool:annotation kind="ref">
|
||||
<tool:expected-type type="javax.resource.spi.ResourceAdapter"/>
|
||||
<tool:expected-type type="jakarta.resource.spi.ResourceAdapter"/>
|
||||
</tool:annotation>
|
||||
</xsd:appinfo>
|
||||
</xsd:annotation>
|
||||
@@ -435,7 +435,7 @@
|
||||
<xsd:documentation><![CDATA[
|
||||
A reference to the DestinationResolver strategy for resolving destination names.
|
||||
Default is to pass in the destination name Strings into the JCA ActivationSpec as-is.
|
||||
Alternatively, specify a reference to a JndiDestinationResolver (typically in a Java EE
|
||||
Alternatively, specify a reference to a JndiDestinationResolver (typically in a Jakarta EE
|
||||
environment, in particular if the server insists on receiving Destination objects).
|
||||
]]></xsd:documentation>
|
||||
<xsd:appinfo>
|
||||
@@ -516,7 +516,7 @@
|
||||
<xsd:attribute name="transaction-manager" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
A reference to the Spring JtaTransactionManager or [javax.transaction.TransactionManager],
|
||||
A reference to the Spring JtaTransactionManager or [jakarta.transaction.TransactionManager],
|
||||
for kicking off an XA transaction for each incoming message.
|
||||
If not specified, native acknowledging will be used (see "acknowledge" attribute).
|
||||
]]></xsd:documentation>
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
package org.springframework.jca;
|
||||
|
||||
import javax.resource.ResourceException;
|
||||
import javax.resource.spi.ActivationSpec;
|
||||
import javax.resource.spi.InvalidPropertyException;
|
||||
import javax.resource.spi.ResourceAdapter;
|
||||
import jakarta.resource.ResourceException;
|
||||
import jakarta.resource.spi.ActivationSpec;
|
||||
import jakarta.resource.spi.InvalidPropertyException;
|
||||
import jakarta.resource.spi.ResourceAdapter;
|
||||
|
||||
/**
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -16,14 +16,15 @@
|
||||
|
||||
package org.springframework.jca;
|
||||
|
||||
import javax.resource.ResourceException;
|
||||
import javax.resource.spi.ActivationSpec;
|
||||
import javax.resource.spi.BootstrapContext;
|
||||
import javax.resource.spi.ResourceAdapter;
|
||||
import javax.resource.spi.ResourceAdapterInternalException;
|
||||
import javax.resource.spi.endpoint.MessageEndpointFactory;
|
||||
import javax.transaction.xa.XAResource;
|
||||
|
||||
import jakarta.resource.ResourceException;
|
||||
import jakarta.resource.spi.ActivationSpec;
|
||||
import jakarta.resource.spi.BootstrapContext;
|
||||
import jakarta.resource.spi.ResourceAdapter;
|
||||
import jakarta.resource.spi.ResourceAdapterInternalException;
|
||||
import jakarta.resource.spi.endpoint.MessageEndpointFactory;
|
||||
|
||||
/**
|
||||
* @author Juergen Hoeller
|
||||
*/
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
package org.springframework.jms;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import javax.jms.ConnectionFactory;
|
||||
import javax.jms.JMSContext;
|
||||
import javax.jms.JMSException;
|
||||
import jakarta.jms.Connection;
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
import jakarta.jms.JMSContext;
|
||||
import jakarta.jms.JMSException;
|
||||
|
||||
/**
|
||||
* A stub implementation of the JMS ConnectionFactory for testing.
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
package org.springframework.jms;
|
||||
|
||||
import javax.jms.Queue;
|
||||
import jakarta.jms.Queue;
|
||||
|
||||
/**
|
||||
* Stub implementation of the {@link javax.jms.Queue} interface.
|
||||
* Stub implementation of the {@link jakarta.jms.Queue} interface.
|
||||
*
|
||||
* @author Rick Evans
|
||||
*/
|
||||
|
||||
@@ -19,9 +19,9 @@ package org.springframework.jms;
|
||||
import java.util.Enumeration;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.TextMessage;
|
||||
import jakarta.jms.Destination;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.TextMessage;
|
||||
|
||||
/**
|
||||
* Stub JMS Message implementation intended for testing purposes only.
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.jms;
|
||||
|
||||
import javax.jms.Topic;
|
||||
import jakarta.jms.Topic;
|
||||
|
||||
/**
|
||||
* Stub implementation of the {@link Topic} interface.
|
||||
|
||||
@@ -18,9 +18,8 @@ package org.springframework.jms.annotation;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Session;
|
||||
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Session;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
@@ -16,9 +16,8 @@
|
||||
|
||||
package org.springframework.jms.annotation;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.MessageListener;
|
||||
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.MessageListener;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
@@ -19,9 +19,8 @@ package org.springframework.jms.annotation;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.MessageListener;
|
||||
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.MessageListener;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
|
||||
@@ -20,12 +20,11 @@ import java.lang.reflect.Method;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.MessageListener;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.TextMessage;
|
||||
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.MessageListener;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.TextMessage;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
@@ -16,11 +16,10 @@
|
||||
|
||||
package org.springframework.jms.config;
|
||||
|
||||
import javax.jms.ConnectionFactory;
|
||||
import javax.jms.MessageListener;
|
||||
import javax.jms.Session;
|
||||
import javax.transaction.TransactionManager;
|
||||
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
import jakarta.jms.MessageListener;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.transaction.TransactionManager;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.DirectFieldAccessor;
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
|
||||
package org.springframework.jms.config;
|
||||
|
||||
import javax.jms.MessageListener;
|
||||
|
||||
import jakarta.jms.MessageListener;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.DirectFieldAccessor;
|
||||
|
||||
@@ -21,11 +21,10 @@ import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.jms.ConnectionFactory;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.MessageListener;
|
||||
import javax.jms.TextMessage;
|
||||
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
import jakarta.jms.Message;
|
||||
import jakarta.jms.MessageListener;
|
||||
import jakarta.jms.TextMessage;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -22,14 +22,13 @@ import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.InvalidDestinationException;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.ObjectMessage;
|
||||
import javax.jms.QueueSender;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.TextMessage;
|
||||
|
||||
import jakarta.jms.Destination;
|
||||
import jakarta.jms.InvalidDestinationException;
|
||||
import jakarta.jms.JMSException;
|
||||
import jakarta.jms.ObjectMessage;
|
||||
import jakarta.jms.QueueSender;
|
||||
import jakarta.jms.Session;
|
||||
import jakarta.jms.TextMessage;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestInfo;
|
||||
@@ -127,7 +126,7 @@ class MethodJmsListenerEndpointTests {
|
||||
|
||||
@Test
|
||||
void resolveMessageAndSession() throws JMSException {
|
||||
MessagingMessageListenerAdapter listener = createDefaultInstance(javax.jms.Message.class, Session.class);
|
||||
MessagingMessageListenerAdapter listener = createDefaultInstance(jakarta.jms.Message.class, Session.class);
|
||||
|
||||
Session session = mock(Session.class);
|
||||
listener.onMessage(createSimpleJmsTextMessage("test"), session);
|
||||
@@ -521,7 +520,7 @@ class MethodJmsListenerEndpointTests {
|
||||
|
||||
private final Map<String, Boolean> invocations = new HashMap<>();
|
||||
|
||||
public void resolveMessageAndSession(javax.jms.Message message, Session session) {
|
||||
public void resolveMessageAndSession(jakarta.jms.Message message, Session session) {
|
||||
this.invocations.put("resolveMessageAndSession", true);
|
||||
assertThat(message).as("Message not injected").isNotNull();
|
||||
assertThat(session).as("Session not injected").isNotNull();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user