KMQueueRequestor Class Reference
Inherits from | KCObject : NSObject |
Declared in | KMQueueRequestor.h |
Overview
The QueueRequestor helper class simplifies making service requests.
KMQueueRequestor is a JMS 1.0 API. KMMessageConsumer or KMTopicSubscriber should be used instead.
The QueueRequestor constructor is given a non-transacted KMQueueSession and a destination KMQueue. It creates a KMTemporaryQueue for the responses and provides a request 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.
Tasks
-
– session
Associated Session
-
– queue
Associated Queue
-
– tempQueue
Associated Temporary Queue
-
– sender
Associated sender
-
– receiver
Associated receiver
-
– initWithSession:queue:
Init using a session and queue. This implementation assumes the session parameter to be non-transacted,with a delivery mode of either AUTO_ACKNOWLEDGE or DUPS_OK_ACKNOWLEDGE.
-
– request:
Sends a request and waits for a reply. The temporary queue is used for the JMSReplyTo destination, and only one reply per request is expected.
-
– close
Closes the QueueRequestor and its session.
Instance Methods
close
Closes the QueueRequestor and its session.
- (void)close
Discussion
Since a provider may allocate some resources on behalf of a QueueRequestor, 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 the KMQueueSession object passed to the QueueRequestor constructor.
Exceptions
- KMJMSException
if the JMS provider fails to close the QueueRequestor due to some internal error.
Declared In
KMQueueRequestor.h
initWithSession:queue:
Init using a session and queue. This implementation assumes the session parameter to be non-transacted,with a delivery mode of either AUTO_ACKNOWLEDGE or DUPS_OK_ACKNOWLEDGE.
- (KMQueueRequestor *)initWithSession:(KMQueueSession *)session queue:(KMQueue *)queue
Parameters
- session
the KMQueueSession the queue belongs to
- queue
the queue to perform the request/reply call on
Exceptions
- KMJMSException
if the JMS provider fails to create the QueueRequestor due to some internal error.
- KMInvalidDestinationException
if an invalid queue is specified.
Declared In
KMQueueRequestor.h
request:
Sends a request and waits for a reply. The temporary queue is used for the JMSReplyTo destination, and only one reply per request is expected.
- (KMMessage *)request:(KMMessage *)message
Parameters
- message
the message to send
Return Value
the reply message
Exceptions
- KMJMSException
if the JMS provider fails to complete the request due to some internal error.
Declared In
KMQueueRequestor.h