Movatterモバイル変換


[0]ホーム

URL:


         


Class TopicRequestor

java.lang.Object  |  +--javax.jms.TopicRequestor

public classTopicRequestor
extends java.lang.Object

TheTopicRequestor helper class simplifies making service requests.

TheTopicRequestor constructor is given a non-transactedTopicSession and a destinationTopic. It creates aTemporaryTopic for the responses and provides arequest method that sends the request message and waits for its reply.

This is a basic request/reply abstraction that should be sufficient for most uses. JMS providers and clients are free to create more sophisticated versions.

See Also:
QueueRequestor

TopicRequestor(TopicSession session,Topic topic)
          Constructor for theTopicRequestor class.
 
close()
          Closes theTopicRequestor and its session.
request(Message message)
          Sends a request and waits for a reply.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

TopicRequestor

publicTopicRequestor(TopicSession session,Topic topic)               throwsJMSException
Constructor for theTopicRequestor class.

This implementation assumes the session parameter to be non-transacted, with a delivery mode of eitherAUTO_ACKNOWLEDGE orDUPS_OK_ACKNOWLEDGE.

Parameters:
session - theTopicSession the topic belongs to
topic - the topic to perform the request/reply call on
Throws:
JMSException - if the JMS provider fails to create theTopicRequestor due to some internal error.
InvalidDestinationException - if an invalid topic is specified.

request

publicMessagerequest(Message message)                throwsJMSException
Sends a request and waits for a reply. The temporary topic is used for theJMSReplyTo destination; the first reply is returned, and any following replies are discarded.
Parameters:
message - the message to send
Returns:
the reply message
Throws:
JMSException - if the JMS provider fails to complete the request due to some internal error.

close

public voidclose()           throwsJMSException
Closes theTopicRequestor and its session.

Since a provider may allocate some resources on behalf of aTopicRequestor outside the Java virtual machine, clients should close them when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough.

Note that this method closes theTopicSession object passed to theTopicRequestor constructor.

Throws:
JMSException - if the JMS provider fails to close theTopicRequestor due to some internal error.

         


[8]ページ先頭

©2009-2025 Movatter.jp