Oracle® Streams Advanced Queuing Java API Reference
Release 1 (10.1)

B12023-01

oracle.jms
Class AQjmsTopicBrowser

java.lang.Object
  |
  +--oracle.jms.AQjmsObject
        |
        +--oracle.jms.AQjmsTopicBrowser
All Implemented Interfaces:
java.util.Enumeration, TopicBrowser

public class AQjmsTopicBrowser
extends oracle.jms.AQjmsObject
implements TopicBrowser, java.util.Enumeration

Oracle class implementing javax.jms.TopicBrowser, java.util.Enumeration


Method Summary
 void close()
           Since a provider may allocate some resources on behalf of a TopicBrowser outside the JVM, clients should close them when they are not needed.
 java.util.Enumeration getEnumeration()
           Get an enumeration for browsing the current topic messages in the order they would be received.
 java.lang.String getMessageSelector()
           Get this topic browser's message selector expression.
 javax.jms.Topic getTopic()
           Get the topic associated with this topic browser.
 java.lang.String getTransformation()
          Get the transformation for the Consumer
 boolean hasMoreElements()
           Check if this enumeration contains more elements.
 java.lang.Object nextElement()
           Returns the next element of this enumeration.
 void purgeSeen()
           Purge messages seen so far during browse.
 void setTransformation(java.lang.String transformation)
          Set transformation for the browser.

 

Methods inherited from class oracle.jms.AQjmsObject
checkClosed, children, finalize, getID, getParent, isOpen, localClose, preClose

 

Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

close

public void close()
           throws JMSException
Description copied from interface: TopicBrowser

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

Specified by:
close in interface TopicBrowser
Overrides:
close in class oracle.jms.AQjmsObject
Throws:
JMSException - if a JMS fails to close this Browser due to some JMS error.

getTopic

public javax.jms.Topic getTopic()
                         throws JMSException

Get the topic associated with this topic browser.

Specified by:
getTopic in interface TopicBrowser
Returns:
the topic
Throws:
JMSException - if JMS fails to get the topic associated with this Browser due to some JMS error.

getEnumeration

public java.util.Enumeration getEnumeration()

Get an enumeration for browsing the current topic messages in the order they would be received.

If getEnumeration() is called twice on the same TopicBrowser, the same enumeration object is returned. Hence the nextElement() call on one enumeration object would modify the state second enumeration object too.

Specified by:
getEnumeration in interface TopicBrowser
Returns:
an enumeration for browsing the messages

getMessageSelector

public java.lang.String getMessageSelector()
                                    throws JMSException

Get this topic browser's message selector expression.

Specified by:
getMessageSelector in interface TopicBrowser
Returns:
this topic browser's message selector
Throws:
JMSException - if JMS fails to get message selector due to some JMS error

nextElement

public java.lang.Object nextElement()
                             throws java.util.NoSuchElementException

Returns the next element of this enumeration.

Attempt to use cached messages (if one is available from a previous call to hasMoreElements()). If the browser's selector used message ID, only one message can ever be returned during the browse; cache this state for subsequent calls.

Specified by:
nextElement in interface java.util.Enumeration
Returns:
the next element of this enumeration
Throws:
java.util.NoSuchElementException - if no more elements exist.

hasMoreElements

public boolean hasMoreElements()

Check if this enumeration contains more elements.

Attempt to cach messages (for use by a subsequent call to nextElement()). If the browser's selector uses message ID, only one message can ever be returned during the browse; cache this state for subsequent calls.

Specified by:
hasMoreElements in interface java.util.Enumeration
Returns:
true if more elements exist in the enumeration false otherwise.

purgeSeen

public void purgeSeen()
               throws JMSException

Purge messages seen so far during browse. The purge will be finalized only when the session for the topic browse is committed.

Specified by:
purgeSeen in interface TopicBrowser
Throws:
JMSException - if a JMS error occurred during the purge operation.

setTransformation

public void setTransformation(java.lang.String transformation)
Set transformation for the browser. This transformation will be applied before the message is returned to the user.
Parameters:
transformation - transformation name

getTransformation

public java.lang.String getTransformation()
Get the transformation for the Consumer

Oracle® Streams Advanced Queuing Java API Reference
Release 1 (10.1)

B12023-01

Copyright © 2003, Oracle. All Rights Reserved.