public class AQjmsConsumer extends oracle.jms.AQjmsObject implements AQjmsQueueReceiver, AQjmsTopicSubscriber, AQjmsTopicReceiver
oracle.jms.AQjmsQueueReceiver, oracle.jms.AQjmsTopicSubscriber and oracle.jms.AQjmsTopicReceiver.| Modifier and Type | Method and Description |
|---|---|
Message |
bufferReceive()
Receives the next message from both the in-memory and persistent portion of the queue.
|
Message |
bufferReceive(long timeout)
Receives the next message from both the in-memory and persistent portion of the queue if one is available within the specified timeout.
|
Message |
bufferReceiveNoWait()
Receives the next message from both the in-memory and persistent portion of the queue if one is immediately available.
|
void |
close()
Public for test harness purposes
|
MessageListener |
getMessageListener()
Gets this message consumer's
MessageListener. |
java.lang.String |
getMessageSelector()
Gets this message consumer's message selector expression.
|
int |
getNavigationMode()
Gets the navigation mode used for receiving messages.
|
boolean |
getNoLocal()
Gets the
NoLocal attribute for this TopicSubscriber. |
Queue |
getQueue()
Gets the queue associated with this queue receiver.
|
Topic |
getTopic()
Gets the topic associated with this topic subscriber.
|
java.lang.String |
getTransformation()
Gets this consumer's transformation.
|
Message |
receive()
Receives the next message.
|
Message |
receive(long timeout)
Receives the next message if one is available within the specified timeout.
|
void |
receiveNoData()
Consumes the message without returning it to the user.
|
void |
receiveNoData(long timeout)
Consumes the message without returning it to the user.
|
Message |
receiveNoWait()
Receives the next message if one is immediately available.
|
void |
setMessageListener(MessageListener myListener)
Set this message consumer's
MessageListener. |
void |
setNavigationMode(int mode)
Sets the navigation mode used for receiving messages.
|
void |
setTransformation(java.lang.String transformation)
Sets this consumer's transformation.
|
checkClosed, children, finalize, getID, getParent, isOpen, localClose, preCloseclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreceivereceive, receive, receiveSignature, receiveSignaturepublic java.lang.String getMessageSelector()
throws JMSException
getMessageSelector in interface MessageConsumerJMSException - if this consumer has already been closed.AQjmsConsumer.close()public MessageListener getMessageListener() throws JMSException
MessageListener.getMessageListener in interface MessageConsumernull if no listener is setJMSException - if:
AQjmsConsumer.close(), AQjmsSession.setMessageListener(javax.jms.MessageListener)public void setMessageListener(MessageListener myListener) throws JMSException
MessageListener. Once set, myListener's MessageListener.onMessage(javax.jms.Message) method is called when there are messages for this consumer.setMessageListener in interface MessageConsumermyListener - the listener to which incoming messages are to be sentJMSException - if:
AQjmsConsumer.close(), AQjmsSession.setMessageListener(javax.jms.MessageListener)public Message receive() throws JMSException
Blocks indefinitely until a message is received or this consumer is closed.
receive in interface MessageConsumernull if the receive was pending and was then terminated due to this consumer being closedJMSException - if the next message is not received due to some error.public Message receiveNoWait() throws JMSException
receiveNoWait in interface MessageConsumernull if none are immediately availableJMSException - if the next message is not received due to some error.public Message receive(long timeout) throws JMSException
Blocks until a message is received, the timeout expires, or this consumer is closed. A timeout of zero never expires.
receive in interface MessageConsumertimeout - the timeout value (in milliseconds)null if none are available in timeJMSException - if the next message is not received due to some error.public Message bufferReceive() throws JMSException
Blocks indefinitely until a message is received or this consumer is closed.
null if the receive was pending and was then terminated due to this consumer being closedJMSException - if the next message is not received due to some error.public Message bufferReceiveNoWait() throws JMSException
null if none are immediately availableJMSException - if the next message is not received due to some error.public Message bufferReceive(long timeout) throws JMSException
Blocks until a message is received, the timeout expires, or this consumer is closed. A timeout of zero never expires.
timeout - the timeout value (in milliseconds)null if none are available in timeJMSException - if the next message is not received due to some error.public void close()
throws JMSException
oracle.jms.AQjmsObjectclose in interface MessageConsumerclose in class oracle.jms.AQjmsObjectJMSException - if the JMS provider fails to close the consumer due to some internal error.public Queue getQueue() throws JMSException
getQueue in interface QueueReceiverJMSException - if called on a topic subscriber.public Topic getTopic() throws JMSException
getTopic in interface TopicSubscribergetTopic in interface TopicReceiverJMSException - if called on a queue receiver.public boolean getNoLocal()
throws JMSException
NoLocal attribute for this TopicSubscriber. The default value for this attribute is false.getNoLocal in interface TopicSubscribertrue if locally published messages are being inhibited.JMSException - if this method is called on a queue receiver.public int getNavigationMode()
throws JMSException
AQjmsConstants.NAVIGATION_FIRST_MESSAGEAQjmsConstants.NAVIGATION_NEXT_MESSAGEAQjmsConstants.NAVIGATION_NEXT_TRANSACTIONgetNavigationMode in interface AQjmsQueueReceivergetNavigationMode in interface AQjmsTopicReceivergetNavigationMode in interface AQjmsTopicSubscriberJMSException - if this consumer has already been closed.public void setNavigationMode(int mode)
throws JMSException
AQjmsConstants.NAVIGATION_FIRST_MESSAGEAQjmsConstants.NAVIGATION_NEXT_MESSAGEAQjmsConstants.NAVIGATION_NEXT_TRANSACTIONsetNavigationMode in interface AQjmsQueueReceiversetNavigationMode in interface AQjmsTopicReceiversetNavigationMode in interface AQjmsTopicSubscribermode - the new navigation mode for this consumerJMSException - if:
mode does not match any of the above listed navigation modes.public void setTransformation(java.lang.String transformation)
setTransformation in interface AQjmsQueueReceiversetTransformation in interface AQjmsTopicReceivertransformation - the transformation to use when getting messagespublic java.lang.String getTransformation()
getTransformation in interface AQjmsQueueReceivergetTransformation in interface AQjmsTopicReceiverpublic void receiveNoData()
throws JMSException
Blocks indefinitely until a message is received or this consumer is closed.
receiveNoData in interface AQjmsQueueReceiverreceiveNoData in interface AQjmsTopicReceiverreceiveNoData in interface AQjmsTopicSubscriberJMSException - if the message could not be received due to some error.public void receiveNoData(long timeout)
throws JMSException
Blocks until a message is received, the timeout expires, or this consumer is closed. A timeout of zero never expires.
receiveNoData in interface AQjmsQueueReceiverreceiveNoData in interface AQjmsTopicReceiverreceiveNoData in interface AQjmsTopicSubscribertimeout - the timeout value in millisecondsJMSException - if the message could not be received due to some error.