diff --git a/spring-core/src/main/java/org/springframework/util/ConcurrencyThrottleSupport.java b/spring-core/src/main/java/org/springframework/util/ConcurrencyThrottleSupport.java index 2f68d557f90..6ab99f168d3 100644 --- a/spring-core/src/main/java/org/springframework/util/ConcurrencyThrottleSupport.java +++ b/spring-core/src/main/java/org/springframework/util/ConcurrencyThrottleSupport.java @@ -51,7 +51,7 @@ public abstract class ConcurrencyThrottleSupport implements Serializable { /** * Concurrency limit which signals unbounded concurrency: {@value}. - *

Setting the limit to this value permits any number of concurrent access: + *

Setting the limit to this value permits unbounded concurrent access: * that is, concurrency will not be throttled. * @see #NO_CONCURRENCY */ @@ -81,12 +81,13 @@ public abstract class ConcurrencyThrottleSupport implements Serializable { /** * Set the maximum number of concurrent access attempts allowed. - * The default of -1 indicates no concurrency limit at all. + * The default of {@value #UNBOUNDED_CONCURRENCY} indicates no concurrency + * limit at all. *

In principle, this limit can be changed at runtime, * although it is generally designed as a config time setting. - *

NOTE: Do not switch between -1 and any concrete limit at runtime, - * as this will lead to inconsistent concurrency counts: A limit - * of -1 effectively turns off concurrency counting completely. + *

NOTE: Do not switch between {@code -1} and any concrete limit at runtime, + * as this will lead to inconsistent concurrency counts. A limit + * of {@code -1} effectively turns off concurrency counting completely. */ public void setConcurrencyLimit(int concurrencyLimit) { this.concurrencyLimit = concurrencyLimit; diff --git a/spring-jms/src/main/java/org/springframework/jms/core/JmsOperations.java b/spring-jms/src/main/java/org/springframework/jms/core/JmsOperations.java index 352d214ec81..3561bab0183 100644 --- a/spring-jms/src/main/java/org/springframework/jms/core/JmsOperations.java +++ b/spring-jms/src/main/java/org/springframework/jms/core/JmsOperations.java @@ -26,15 +26,15 @@ import org.springframework.jms.JmsException; /** * Specifies a basic set of JMS operations. * - *

Implemented by {@link JmsTemplate}. Not often used but a useful option - * to enhance testability, as it can easily be mocked or stubbed. + *

Implemented by {@link JmsTemplate}. Not often used directly, but a useful + * option to enhance testability, as it can easily be mocked or stubbed. * *

Provides {@code JmsTemplate's} {@code send(..)} and * {@code receive(..)} methods that mirror various JMS API methods. * See the JMS specification and javadocs for details on those methods. * - *

Provides also basic request reply operation using a temporary - * queue to collect the reply. + *

Provides also basic request-reply operations using a temporary queue to + * receive the reply. * * @author Mark Pollack * @author Juergen Hoeller @@ -58,7 +58,7 @@ public interface JmsOperations { /** * Send messages to the default JMS destination (or one specified - * for each send operation). The callback gives access to the JMS Session + * for each send operation). The callback provides access to the JMS Session * and MessageProducer in order to perform complex send operations. * @param action callback object that exposes the session/producer pair * @return the result object from working with the session @@ -67,7 +67,7 @@ public interface JmsOperations { @Nullable T execute(ProducerCallback action) throws JmsException; /** - * Send messages to a JMS destination. The callback gives access to the JMS Session + * Send messages to a JMS destination. The callback provides access to the JMS Session * and MessageProducer in order to perform complex send operations. * @param destination the destination to send messages to * @param action callback object that exposes the session/producer pair @@ -77,7 +77,7 @@ public interface JmsOperations { @Nullable T execute(Destination destination, ProducerCallback action) throws JmsException; /** - * Send messages to a JMS destination. The callback gives access to the JMS Session + * Send messages to a JMS destination. The callback provides access to the JMS Session * and MessageProducer in order to perform complex send operations. * @param destinationName the name of the destination to send messages to * (to be resolved to an actual destination by a DestinationResolver) @@ -402,10 +402,12 @@ public interface JmsOperations { @Nullable Message sendAndReceive(String destinationName, MessageCreator messageCreator) throws JmsException; /** - * Send a message and receive the reply from the specified destination. The - * {@link MessageCreator} callback creates the message given a Session. A given - * responseQueue is set in the {@code JMSReplyTO} header of the message. - * @param destination the destination to send this message to + * Send a message to the specified destination and receive the reply from the + * specified response queue. + *

The {@link MessageCreator} callback creates the message given a Session, + * and the specified {@code responseQueue} is set in the {@code JMSReplyTO} + * header of the message. + * @param destination the destination to send the message to * @param responseQueue the destination to receive the reply from * @param messageCreator callback to create a message * @return the reply, possibly {@code null} if the message could not be received, @@ -413,13 +415,16 @@ public interface JmsOperations { * @throws JmsException checked JMSException converted to unchecked * @since 7.0.4 */ - @Nullable Message sendAndReceive(Destination destination, Destination responseQueue, MessageCreator messageCreator) throws JmsException; + @Nullable Message sendAndReceive(Destination destination, Destination responseQueue, MessageCreator messageCreator) + throws JmsException; /** - * Send a message and receive the reply from the specified destination. The - * {@link MessageCreator} callback creates the message given a Session. A given - * responseQueue is set in the {@code JMSReplyTO} header of the message. - * @param destinationName the name of the destination to send this message to + * Send a message to the specified destination and receive the reply from the + * specified response queue. + *

The {@link MessageCreator} callback creates the message given a Session, + * and the destination with the specified {@code responseQueueName} is set in + * the {@code JMSReplyTO} header of the message. + * @param destinationName the name of the destination to send the message to * (to be resolved to an actual destination by a DestinationResolver) * @param responseQueueName the name of the destination to receive the reply from * (to be resolved to an actual destination by a DestinationResolver) @@ -429,7 +434,8 @@ public interface JmsOperations { * @throws JmsException checked JMSException converted to unchecked * @since 7.0.4 */ - @Nullable Message sendAndReceive(String destinationName, String responseQueueName, MessageCreator messageCreator) throws JmsException; + @Nullable Message sendAndReceive(String destinationName, String responseQueueName, MessageCreator messageCreator) + throws JmsException; //--------------------------------------------------------------------------------------- @@ -437,7 +443,7 @@ public interface JmsOperations { //--------------------------------------------------------------------------------------- /** - * Browse messages in the default JMS queue. The callback gives access to the JMS + * Browse messages in the default JMS queue. The callback provides access to the JMS * Session and QueueBrowser in order to browse the queue and react to the contents. * @param action callback object that exposes the session/browser pair * @return the result object from working with the session @@ -446,7 +452,7 @@ public interface JmsOperations { @Nullable T browse(BrowserCallback action) throws JmsException; /** - * Browse messages in a JMS queue. The callback gives access to the JMS Session + * Browse messages in a JMS queue. The callback provides access to the JMS Session * and QueueBrowser in order to browse the queue and react to the contents. * @param queue the queue to browse * @param action callback object that exposes the session/browser pair @@ -456,7 +462,7 @@ public interface JmsOperations { @Nullable T browse(Queue queue, BrowserCallback action) throws JmsException; /** - * Browse messages in a JMS queue. The callback gives access to the JMS Session + * Browse messages in a JMS queue. The callback provides access to the JMS Session * and QueueBrowser in order to browse the queue and react to the contents. * @param queueName the name of the queue to browse * (to be resolved to an actual destination by a DestinationResolver) @@ -467,7 +473,7 @@ public interface JmsOperations { @Nullable T browse(String queueName, BrowserCallback action) throws JmsException; /** - * Browse selected messages in a JMS queue. The callback gives access to the JMS + * Browse selected messages in a JMS queue. The callback provides access to the JMS * Session and QueueBrowser in order to browse the queue and react to the contents. * @param messageSelector the JMS message selector expression (or {@code null} if none). * See the JMS specification for a detailed definition of selector expressions. @@ -478,7 +484,7 @@ public interface JmsOperations { @Nullable T browseSelected(@Nullable String messageSelector, BrowserCallback action) throws JmsException; /** - * Browse selected messages in a JMS queue. The callback gives access to the JMS + * Browse selected messages in a JMS queue. The callback provides access to the JMS * Session and QueueBrowser in order to browse the queue and react to the contents. * @param queue the queue to browse * @param messageSelector the JMS message selector expression (or {@code null} if none). @@ -487,10 +493,11 @@ public interface JmsOperations { * @return the result object from working with the session * @throws JmsException checked JMSException converted to unchecked */ - @Nullable T browseSelected(Queue queue, @Nullable String messageSelector, BrowserCallback action) throws JmsException; + @Nullable T browseSelected(Queue queue, @Nullable String messageSelector, BrowserCallback action) + throws JmsException; /** - * Browse selected messages in a JMS queue. The callback gives access to the JMS + * Browse selected messages in a JMS queue. The callback provides access to the JMS * Session and QueueBrowser in order to browse the queue and react to the contents. * @param queueName the name of the queue to browse * (to be resolved to an actual destination by a DestinationResolver) @@ -500,6 +507,7 @@ public interface JmsOperations { * @return the result object from working with the session * @throws JmsException checked JMSException converted to unchecked */ - @Nullable T browseSelected(String queueName, @Nullable String messageSelector, BrowserCallback action) throws JmsException; + @Nullable T browseSelected(String queueName, @Nullable String messageSelector, BrowserCallback action) + throws JmsException; } diff --git a/spring-jms/src/main/java/org/springframework/jms/core/JmsTemplate.java b/spring-jms/src/main/java/org/springframework/jms/core/JmsTemplate.java index 20588185cc6..63e9d18df04 100644 --- a/spring-jms/src/main/java/org/springframework/jms/core/JmsTemplate.java +++ b/spring-jms/src/main/java/org/springframework/jms/core/JmsTemplate.java @@ -923,7 +923,7 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations /** * Send a request message to the given {@link Destination destination} and block until * a reply has been received on a temporary queue created on-the-fly. - *

Return the response message or {@code null} if no message has + *

Return the response message or {@code null} if no message has been received. * @throws JMSException if thrown by JMS API methods */ protected @Nullable Message doSendAndReceive(Session session, Destination destination, MessageCreator messageCreator) @@ -943,8 +943,8 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations /** * Send a request message to the given {@link Destination destination} and block until - * a reply has been received on a {@link Destination responseQueue} queue. - *

Return the response message or {@code null} if no message has + * a reply has been received on the specified {@link Destination responseQueue}. + *

Return the response message or {@code null} if no message has been received. * @throws JMSException if thrown by JMS API methods */ protected @Nullable Message doSendAndReceive(Session session, Destination destination, Destination responseQueue, MessageCreator messageCreator)