KMQueueBrowser Class Reference
Inherits from | KCObject : NSObject |
Declared in | KMQueueBrowser.h |
Overview
A client uses a KMQueueBrowser object to look at messages on a queue without removing them.
The getEnumeration method returns an NSEnumerator to scan the queue’s messages. It may be an enumeration of the entire content of a queue, or it may contain only the messages matching a message selector.
Messages may be arriving and expiring while the scan is done. The JMS API does not require the content of an enumeration to be a static snapshot of queue content. Whether these changes are visible or not depends on the JMS provider.
A KMQueueBrowser can be created from either a Session.
Tasks
-
– queue
Gets the queue associated with this queue browser.
-
– messageSelector
Gets this queue browser’s message selector expression.
-
– enumeration
Gets an enumeration for browsing the current queue messages in the order they would be received.
-
– close
Closes the QueueBrowser.
Instance Methods
close
Closes the QueueBrowser.
- (void)close
Discussion
Since a provider may allocate some resources on behalf of a QueueBrowser 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.
Exceptions
- KMJMSException
if the JMS provider fails to close this browser due to some internal error.
Declared In
KMQueueBrowser.h
enumeration
Gets an enumeration for browsing the current queue messages in the order they would be received.
- (NSEnumerator *)enumeration
Return Value
an enumeration for browsing the messages
Exceptions
- KMJMSException
if the JMS provider fails to get the enumeration for this browser due to some internal error.
Declared In
KMQueueBrowser.h
messageSelector
Gets this queue browser’s message selector expression.
- (NSString *)messageSelector
Return Value
this queue browser’s message selector, or null if no message selector exists for the message consumer (that is, if the message selector was not set or was set to null or the empty string)
Exceptions
- KMJMSException
if the JMS provider fails to get the message selector for this browser due to some internal error.
Declared In
KMQueueBrowser.h