|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface that specifies a basic set of JMS operations. Implemented by JmsTemplate. Not often used but a useful option to enhance testability, as it can easily be mocked or stubbed.
Provides JmsTemplate's send and receive methods that mirror various JMS API methods. See the JMS specification and javadocs for details on those methods.
JmsTemplate
,
Destination
,
Session
,
MessageProducer
,
MessageConsumer
Method Summary | |
void |
convertAndSend(Destination destination,
Object message)
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter. |
void |
convertAndSend(Destination destination,
Object message,
MessagePostProcessor postProcessor)
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter. |
void |
convertAndSend(Object message)
Send the given object to the default destination, converting the object to a JMS message with a configured MessageConverter. |
void |
convertAndSend(Object message,
MessagePostProcessor postProcessor)
Send the given object to the default destination, converting the object to a JMS message with a configured MessageConverter. |
void |
convertAndSend(String destinationName,
Object message)
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter. |
void |
convertAndSend(String destinationName,
Object message,
MessagePostProcessor postProcessor)
Send the given object to the specified destination, converting the object to a JMS message with a configured MessageConverter. |
Object |
execute(ProducerCallback action)
Send a message to a JMS destination. |
Object |
execute(SessionCallback action)
Execute the action specified by the given action object within a JMS Session. |
Message |
receive()
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery. |
Message |
receive(Destination destination)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. |
Message |
receive(String destinationName)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. |
Object |
receiveAndConvert()
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery. |
Object |
receiveAndConvert(Destination destination)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. |
Object |
receiveAndConvert(String destinationName)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. |
Message |
receiveSelected(Destination destination,
String messageSelector)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. |
Message |
receiveSelected(String messageSelector)
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery. |
Message |
receiveSelected(String destinationName,
String messageSelector)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. |
Object |
receiveSelectedAndConvert(Destination destination,
String messageSelector)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. |
Object |
receiveSelectedAndConvert(String messageSelector)
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery. |
Object |
receiveSelectedAndConvert(String destinationName,
String messageSelector)
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. |
void |
send(Destination destination,
MessageCreator messageCreator)
Send a message to the specified destination. |
void |
send(MessageCreator messageCreator)
Send a message to the default destination. |
void |
send(String destinationName,
MessageCreator messageCreator)
Send a message to the specified destination. |
Method Detail |
public Object execute(SessionCallback action) throws JmsException
When used with a 1.0.2 provider, you may need to downcast to the appropriate domain implementation, either QueueSession or TopicSession in the action objects doInJms callback method.
Note: The value of isPubSubDomain affects the behavior of this method. If isPubSubDomain equals true, then a TopicSession is passed to the callback. If false, then a QueueSession is passed to the callback.
action
- callback object that exposes the session
JmsException
- if there is any problempublic Object execute(ProducerCallback action) throws JmsException
action
- callback object that exposes the session/producer pair
JmsException
- checked JMSException converted to uncheckedpublic void send(MessageCreator messageCreator) throws JmsException
This will only work with a default destination specified!
messageCreator
- callback to create a message.
JmsException
- checked JMSException converted to uncheckedpublic void send(Destination destination, MessageCreator messageCreator) throws JmsException
destination
- the destination to send this message tomessageCreator
- callback to create a message.
JmsException
- checked JMSException converted to uncheckedpublic void send(String destinationName, MessageCreator messageCreator) throws JmsException
destinationName
- the name of the destination to send this message to
(to be resolved to an actual destination by a DestinationResolver)messageCreator
- callback to create a message.
JmsException
- checked JMSException converted to uncheckedpublic void convertAndSend(Object message) throws JmsException
This will only work with a default destination specified!
message
- the object to convert to a message
JmsException
- converted checked JMSException to uncheckedpublic void convertAndSend(Destination destination, Object message) throws JmsException
destination
- the destination to send this message tomessage
- the object to convert to a message
JmsException
- converted checked JMSException to uncheckedpublic void convertAndSend(String destinationName, Object message) throws JmsException
destinationName
- the name of the destination to send this message to
(to be resolved to an actual destination by a DestinationResolver)message
- the object to convert to a message
JmsException
- checked JMSException converted to uncheckedpublic void convertAndSend(Object message, MessagePostProcessor postProcessor) throws JmsException
This will only work with a default destination specified!
message
- the object to convert to a messagepostProcessor
- the callback to modify the message
JmsException
- checked JMSException converted to uncheckedpublic void convertAndSend(Destination destination, Object message, MessagePostProcessor postProcessor) throws JmsException
destination
- the destination to send this message tomessage
- the object to convert to a messagepostProcessor
- the callback to modify the message
JmsException
- checked JMSException converted to uncheckedpublic void convertAndSend(String destinationName, Object message, MessagePostProcessor postProcessor) throws JmsException
destinationName
- the name of the destination to send this message to
(to be resolved to an actual destination by a DestinationResolver)message
- the object to convert to a message.postProcessor
- the callback to modify the message
JmsException
- checked JMSException converted to uncheckedpublic Message receive() throws JmsException
This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.
This will only work with a default destination specified!
JmsException
- checked JMSException converted to uncheckedpublic Message receive(Destination destination) throws JmsException
This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.
destination
- the destination to receive a message from
JmsException
- checked JMSException converted to uncheckedpublic Message receive(String destinationName) throws JmsException
This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.
destinationName
- the name of the destination to send this message to
(to be resolved to an actual destination by a DestinationResolver)
JmsException
- checked JMSException converted to uncheckedpublic Message receiveSelected(String messageSelector) throws JmsException
This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.
This will only work with a default destination specified!
messageSelector
- the JMS message selector expression (or null if none).
See the JMS specification for a detailed definition of selector expressions.
JmsException
- checked JMSException converted to uncheckedpublic Message receiveSelected(Destination destination, String messageSelector) throws JmsException
This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.
destination
- the destination to receive a message frommessageSelector
- the JMS message selector expression (or null if none).
See the JMS specification for a detailed definition of selector expressions.
JmsException
- checked JMSException converted to uncheckedpublic Message receiveSelected(String destinationName, String messageSelector) throws JmsException
This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.
destinationName
- the name of the destination to send this message to
(to be resolved to an actual destination by a DestinationResolver)messageSelector
- the JMS message selector expression (or null if none).
See the JMS specification for a detailed definition of selector expressions.
JmsException
- checked JMSException converted to uncheckedpublic Object receiveAndConvert() throws JmsException
This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.
This will only work with a default destination specified!
JmsException
- checked JMSException converted to uncheckedpublic Object receiveAndConvert(Destination destination) throws JmsException
This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.
destination
- the destination to receive a message from
JmsException
- checked JMSException converted to uncheckedpublic Object receiveAndConvert(String destinationName) throws JmsException
This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.
destinationName
- the name of the destination to send this message to
(to be resolved to an actual destination by a DestinationResolver)
JmsException
- checked JMSException converted to uncheckedpublic Object receiveSelectedAndConvert(String messageSelector) throws JmsException
This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.
This will only work with a default destination specified!
messageSelector
- the JMS message selector expression (or null if none).
See the JMS specification for a detailed definition of selector expressions.
JmsException
- checked JMSException converted to uncheckedpublic Object receiveSelectedAndConvert(Destination destination, String messageSelector) throws JmsException
This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.
destination
- the destination to receive a message frommessageSelector
- the JMS message selector expression (or null if none).
See the JMS specification for a detailed definition of selector expressions.
JmsException
- checked JMSException converted to uncheckedpublic Object receiveSelectedAndConvert(String destinationName, String messageSelector) throws JmsException
This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.
destinationName
- the name of the destination to send this message to
(to be resolved to an actual destination by a DestinationResolver)messageSelector
- the JMS message selector expression (or null if none).
See the JMS specification for a detailed definition of selector expressions.
JmsException
- checked JMSException converted to unchecked
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |