Clean up some JavaDocs; remove deprecated API

This commit is contained in:
Artem Bilan
2022-04-08 16:05:43 -04:00
parent 10ea577549
commit 799802c0d1
40 changed files with 182 additions and 1553 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -392,8 +392,8 @@ public class ChannelPublishingJmsMessageListener
this.gatewayDelegate.stop();
}
private void copyCorrelationIdFromRequestToReply(jakarta.jms.Message requestMessage, jakarta.jms.Message replyMessage)
throws JMSException {
private void copyCorrelationIdFromRequestToReply(jakarta.jms.Message requestMessage,
jakarta.jms.Message replyMessage) throws JMSException {
if (this.correlationKey != null) {
if (this.correlationKey.equals("JMSCorrelationID")) {
@@ -417,9 +417,8 @@ public class ChannelPublishingJmsMessageListener
/**
* Determine a reply destination for the given message.
* <p>
* This implementation first checks the boolean 'error' flag which signifies that the reply is an error message. If
* reply is not an error it will first check the JMS Reply-To {@link Destination} of the supplied request message;
* <p> This implementation first checks the boolean 'error' flag which signifies that the reply is an error message.
* If reply is not an error it will first check the JMS Reply-To {@link Destination} of the supplied request message;
* if that is not <code>null</code> it is returned; if it is <code>null</code>, then the configured
* {@link #resolveDefaultReplyDestination default reply destination} is returned; if this too is <code>null</code>,
* then an {@link InvalidDestinationException} is thrown.
@@ -458,8 +457,7 @@ public class ChannelPublishingJmsMessageListener
if (this.defaultReplyDestination instanceof Destination) {
return (Destination) this.defaultReplyDestination;
}
if (this.defaultReplyDestination instanceof DestinationNameHolder) {
DestinationNameHolder nameHolder = (DestinationNameHolder) this.defaultReplyDestination;
if (this.defaultReplyDestination instanceof DestinationNameHolder nameHolder) {
return this.destinationResolver.resolveDestinationName(session, nameHolder.name, nameHolder.isTopic);
}
return null;
@@ -486,16 +484,7 @@ public class ChannelPublishingJmsMessageListener
* Internal class combining a destination name
* and its target destination type (queue or topic).
*/
private static final class DestinationNameHolder {
private final String name;
private final boolean isTopic;
DestinationNameHolder(String name, boolean isTopic) {
this.name = name;
this.isTopic = isTopic;
}
private record DestinationNameHolder(String name, boolean isTopic) {
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@ package org.springframework.integration.jms;
import jakarta.jms.Destination;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.core.convert.ConversionService;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.Expression;
@@ -60,6 +61,7 @@ public class JmsSendingMessageHandler extends AbstractMessageHandler {
public JmsSendingMessageHandler(JmsTemplate jmsTemplate) {
Assert.notNull(jmsTemplate, "'jmsTemplate' must not be null");
this.jmsTemplate = jmsTemplate;
}
@@ -145,14 +147,15 @@ public class JmsSendingMessageHandler extends AbstractMessageHandler {
@Override
protected void onInit() {
BeanFactory beanFactory = getBeanFactory();
if (this.destinationExpressionProcessor != null) {
this.destinationExpressionProcessor.setBeanFactory(getBeanFactory());
this.destinationExpressionProcessor.setBeanFactory(beanFactory);
ConversionService conversionService = getConversionService();
if (conversionService != null) {
this.destinationExpressionProcessor.setConversionService(conversionService);
}
}
this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory());
this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(beanFactory);
}
@Override
@@ -201,7 +204,8 @@ public class JmsSendingMessageHandler extends AbstractMessageHandler {
Object result = this.destinationExpressionProcessor.processMessage(message);
if (!(result instanceof Destination || result instanceof String)) {
throw new MessageDeliveryException(message,
"Evaluation of destinationExpression failed to produce a Destination or destination name. Result was: " + result);
"Evaluation of destinationExpression failed to produce a Destination or destination name. " +
"Result was: " + result);
}
return result;
}
@@ -221,16 +225,8 @@ public class JmsSendingMessageHandler extends AbstractMessageHandler {
}
private static final class HeaderMappingMessagePostProcessor implements MessagePostProcessor {
private final Message<?> integrationMessage;
private final JmsHeaderMapper headerMapper;
HeaderMappingMessagePostProcessor(Message<?> integrationMessage, JmsHeaderMapper headerMapper) {
this.integrationMessage = integrationMessage;
this.headerMapper = headerMapper;
}
private record HeaderMappingMessagePostProcessor(Message<?> integrationMessage, JmsHeaderMapper headerMapper)
implements MessagePostProcessor {
@Override
public jakarta.jms.Message postProcessMessage(jakarta.jms.Message jmsMessage) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 the original author or authors.
* Copyright 2016-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,18 +16,24 @@
package org.springframework.integration.jms;
import java.io.Serial;
import org.springframework.jms.JmsException;
/**
* A timeout occurred within an async gateway.
*
* @author Gary Russell
* @author Artem Bilan
*
* @since 4.3
*
*/
@SuppressWarnings("serial")
public class JmsTimeoutException extends JmsException {
@Serial
private static final long serialVersionUID = 5439915454935047936L;
public JmsTimeoutException(String description) {
super(description);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016-2021 the original author or authors.
* Copyright 2016-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -209,17 +209,6 @@ public class JmsInboundGatewaySpec<S extends JmsInboundGatewaySpec<S>>
this.spec.get().setAutoStartup(false);
}
/**
* @param destination the destination
* @return the spec.
* @deprecated since 5.5 in favor of {@link #requestDestination(Destination)}
* @see JmsListenerContainerSpec#destination(Destination)
*/
@Deprecated
public JmsInboundGatewayListenerContainerSpec<S, C> destination(Destination destination) {
return requestDestination(destination);
}
/**
* Specify a request destination for incoming messages.
* @param requestDestination the destination
@@ -232,17 +221,6 @@ public class JmsInboundGatewaySpec<S extends JmsInboundGatewaySpec<S>>
return _this();
}
/**
* @param destinationName the destinationName
* @return the spec.
* @deprecated since 5.5 in favor of {@link #requestDestination(String)}
* @see JmsListenerContainerSpec#destination(String)
*/
@Deprecated
public JmsInboundGatewayListenerContainerSpec<S, C> destination(String destinationName) {
return requestDestination(destinationName);
}
/**
* Specify a request destination for incoming messages.
* @param requestDestinationName the destination name