cgl.narada.jms
Class JmsMessageConsumer

java.lang.Object
  extended by cgl.narada.jms.JmsMessageConsumer
All Implemented Interfaces:
MessageConsumer
Direct Known Subclasses:
JmsTopicSubscriber

public class JmsMessageConsumer
extends Object
implements MessageConsumer

A client uses a MessageConsumer object to receive messages from a destination. A MessageConsumer object is created by passing a Destination object to a message-consumer creation method supplied by a session. MessageConsumer is the parent interface for all message consumers.


Constructor Summary
JmsMessageConsumer()
           
 
Method Summary
 void close()
          Closes the message consumer.
 MessageListener getMessageListener()
          Gets the message consumer's MessageListener.
 String getMessageSelector()
          Gets this message consumer's message selector expression.
 Message receive()
          Receives the next message produced for this message consumer.
 Message receive(long timeout)
          Receives the next message that arrives within the specified timeout interval.
 Message receiveNoWait()
          Receives the next message if one is immediately available.
 void setMessageListener(MessageListener listener)
          Sets the message consumer's MessageListener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmsMessageConsumer

public JmsMessageConsumer()
Method Detail

getMessageSelector

public String getMessageSelector()
                          throws JMSException
Gets this message consumer's message selector expression.

Specified by:
getMessageSelector in interface MessageConsumer
Throws:
JMSException

getMessageListener

public MessageListener getMessageListener()
                                   throws JMSException
Gets the message consumer's MessageListener.

Specified by:
getMessageListener in interface MessageConsumer
Returns:
the listener for the message consumer, or null if no listener is set.
Throws:
JMSException

setMessageListener

public void setMessageListener(MessageListener listener)
                        throws JMSException
Sets the message consumer's MessageListener. Setting the message listener to null is the equivalent of unsetting the message listener for the message consumer.

Specified by:
setMessageListener in interface MessageConsumer
Throws:
JMSException

receive

public Message receive()
                throws JMSException
Receives the next message produced for this message consumer. This call blocks indefinitely until a message is produced or until this message consumer is closed.

Specified by:
receive in interface MessageConsumer
Throws:
JMSException

receive

public Message receive(long timeout)
                throws JMSException
Receives the next message that arrives within the specified timeout interval.

Specified by:
receive in interface MessageConsumer
Throws:
JMSException

receiveNoWait

public Message receiveNoWait()
                      throws JMSException
Receives the next message if one is immediately available.

Specified by:
receiveNoWait in interface MessageConsumer
Throws:
JMSException

close

public void close()
           throws JMSException
Closes the message consumer.

Specified by:
close in interface MessageConsumer
Throws:
JMSException


For comments and suggestions please send e-mail to The NaradaBrokering Project