|
|
|
|
@ -26,15 +26,15 @@ import org.springframework.jms.JmsException;
@@ -26,15 +26,15 @@ import org.springframework.jms.JmsException;
|
|
|
|
|
/** |
|
|
|
|
* Specifies a basic set of JMS operations. |
|
|
|
|
* |
|
|
|
|
* <p>Implemented by {@link JmsTemplate}. Not often used but a useful option |
|
|
|
|
* to enhance testability, as it can easily be mocked or stubbed. |
|
|
|
|
* <p>Implemented by {@link JmsTemplate}. Not often used directly, but a useful |
|
|
|
|
* option to enhance testability, as it can easily be mocked or stubbed. |
|
|
|
|
* |
|
|
|
|
* <p>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. |
|
|
|
|
* |
|
|
|
|
* <p>Provides also basic request reply operation using a temporary |
|
|
|
|
* queue to collect the reply. |
|
|
|
|
* <p>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 {
@@ -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 {
@@ -67,7 +67,7 @@ public interface JmsOperations {
|
|
|
|
|
<T> @Nullable T execute(ProducerCallback<T> 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 {
@@ -77,7 +77,7 @@ public interface JmsOperations {
|
|
|
|
|
<T> @Nullable T execute(Destination destination, ProducerCallback<T> 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 {
@@ -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. |
|
|
|
|
* <p>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 {
@@ -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. |
|
|
|
|
* <p>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 {
@@ -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 {
@@ -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 {
@@ -446,7 +452,7 @@ public interface JmsOperations {
|
|
|
|
|
<T> @Nullable T browse(BrowserCallback<T> 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 {
@@ -456,7 +462,7 @@ public interface JmsOperations {
|
|
|
|
|
<T> @Nullable T browse(Queue queue, BrowserCallback<T> 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 {
@@ -467,7 +473,7 @@ public interface JmsOperations {
|
|
|
|
|
<T> @Nullable T browse(String queueName, BrowserCallback<T> 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 {
@@ -478,7 +484,7 @@ public interface JmsOperations {
|
|
|
|
|
<T> @Nullable T browseSelected(@Nullable String messageSelector, BrowserCallback<T> 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 {
@@ -487,10 +493,11 @@ public interface JmsOperations {
|
|
|
|
|
* @return the result object from working with the session |
|
|
|
|
* @throws JmsException checked JMSException converted to unchecked |
|
|
|
|
*/ |
|
|
|
|
<T> @Nullable T browseSelected(Queue queue, @Nullable String messageSelector, BrowserCallback<T> action) throws JmsException; |
|
|
|
|
<T> @Nullable T browseSelected(Queue queue, @Nullable String messageSelector, BrowserCallback<T> 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 {
@@ -500,6 +507,7 @@ public interface JmsOperations {
|
|
|
|
|
* @return the result object from working with the session |
|
|
|
|
* @throws JmsException checked JMSException converted to unchecked |
|
|
|
|
*/ |
|
|
|
|
<T> @Nullable T browseSelected(String queueName, @Nullable String messageSelector, BrowserCallback<T> action) throws JmsException; |
|
|
|
|
<T> @Nullable T browseSelected(String queueName, @Nullable String messageSelector, BrowserCallback<T> action) |
|
|
|
|
throws JmsException; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|