org.sandev.tools.util
Class SandTopicRequestor
java.lang.Object
org.sandev.tools.util.SandTopicRequestor
public class SandTopicRequestor
- extends java.lang.Object
JMS Helper class that performs a request/response using a temporary topic
with a timeout. Based on the TopicRequestor class in JMS. Doesn't extend
TopicRequestor because TopicRequestor's not set up for extension.
|
Field Summary |
protected javax.jms.TopicPublisher |
publisher
|
protected javax.jms.TopicSession |
session
|
protected javax.jms.TopicSubscriber |
subscriber
|
protected javax.jms.TemporaryTopic |
tempTopic
|
|
Constructor Summary |
SandTopicRequestor(javax.jms.TopicSession session,
javax.jms.Topic topic)
Constructor. |
|
Method Summary |
void |
close()
Close the requestor and its session and delete the temporary topic. |
javax.jms.Message |
request(javax.jms.Message message,
long timeout)
Send a message and wait up to timeout ms for a reply. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
session
protected javax.jms.TopicSession session
tempTopic
protected javax.jms.TemporaryTopic tempTopic
publisher
protected javax.jms.TopicPublisher publisher
subscriber
protected javax.jms.TopicSubscriber subscriber
SandTopicRequestor
public SandTopicRequestor(javax.jms.TopicSession session,
javax.jms.Topic topic)
throws javax.jms.JMSException
- Constructor.
- Throws:
javax.jms.JMSException
request
public javax.jms.Message request(javax.jms.Message message,
long timeout)
throws javax.jms.JMSException
- Send a message and wait up to
timeout ms for a reply.
Sets temporary topic as the JMSReplyTo and returns the
first reply on that topic.
- Throws:
javax.jms.JMSException
close
public void close()
throws javax.jms.JMSException
- Close the requestor and its session and delete the temporary topic.
- Throws:
javax.jms.JMSException