jms4spread
Class MessageConsumer

java.lang.Object
  |
  +--jms4spread.MessageConsumer
Direct Known Subclasses:
TopicSubscriber

public class MessageConsumer
extends java.lang.Object

A client uses a Messageconsumer to get a Message for a destination. It is the parent for all Message Conusmers


Method Summary
 void close()
          Performs cleanup for a Message Consumer.
 MessageListener getMessageListener()
          Gets the Message Listener
 java.lang.String getMessageSelector()
          This is a place holder - not yet implemented
 Message receive()
          Gets a message form JMS4spread.
 Message receive(int timeout)
          Gets a message form JMS4spread
 Message receiveNoWait()
          Gets a message form JMS4spread or return immedeiately in case there is none.
 void setMessageListener(MessageListener ml)
          Set the Message Listener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMessageSelector

public java.lang.String getMessageSelector()
                                    throws JMSException
This is a place holder - not yet implemented

close

public void close()
           throws JMSException
Performs cleanup for a Message Consumer. Resourced for receiving messages are allocated outside the JVM, and it is important to call this method.
Throws:
JMSException - in chase of an external (Spread) error

receive

public Message receive(int timeout)
                throws JMSException
Gets a message form JMS4spread
Parameters:
timeout - the time to wait before returning in case there is no message
Returns:
Message

receive

public Message receive()
                throws JMSException
Gets a message form JMS4spread. This is a blocking method.
Returns:
Message

receiveNoWait

public Message receiveNoWait()
                      throws JMSException
Gets a message form JMS4spread or return immedeiately in case there is none.
Returns:
Message

setMessageListener

public void setMessageListener(MessageListener ml)
                        throws JMSException
Set the Message Listener
Parameters:
ml - A MessageListener
Throws:
JMSException - in case of internal error

getMessageListener

public MessageListener getMessageListener()
                                   throws JMSException
Gets the Message Listener
Returns:
MessageListener
Throws:
JMSException - in case of internal error