Movatterモバイル変換


[0]ホーム

URL:


         


Class QueueRequestor

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

public classQueueRequestor
extends java.lang.Object

TheQueueRequestor helper class simplifies making service requests.

TheQueueRequestor constructor is given a non-transactedQueueSession and a destinationQueue. It creates aTemporaryQueue 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:
TopicRequestor

QueueRequestor(QueueSession session,Queue queue)
          Constructor for theQueueRequestor class.
 
close()
          Closes theQueueRequestor 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
 

QueueRequestor

publicQueueRequestor(QueueSession session,Queue queue)               throwsJMSException
Constructor for theQueueRequestor class.

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

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

request

publicMessagerequest(Message message)                throwsJMSException
Sends a request and waits for a reply. The temporary queue is used for theJMSReplyTo destination, and only one reply per request is expected.
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 theQueueRequestor and its session.

Since a provider may allocate some resources on behalf of aQueueRequestor 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 theQueueSession object passed to theQueueRequestor constructor.

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

         


[8]ページ先頭

©2009-2025 Movatter.jp