org.objectweb.joram.client.jms

Class MessageConsumer

Implemented Interfaces:
javax.jms.MessageConsumer
Known Direct Subclasses:
QueueReceiver, TopicSubscriber

public class MessageConsumer
extends java.lang.Object
implements javax.jms.MessageConsumer

Implements the javax.jms.MessageConsumer interface.

Field Summary

protected boolean
closed
true if the consumer is closed.
protected Destination
dest
The destination the consumer gets its messages from.
protected boolean
noLocal
true if the subscriber does not wish to consume messages produced by its connection.

Method Summary

void
close()
API method.
javax.jms.MessageListener
getMessageListener()
API method.
String
getMessageSelector()
API method.
javax.jms.Message
receive()
API method.
javax.jms.Message
receive(long timeOut)
API method implemented in subclasses.
javax.jms.Message
receiveNoWait()
API method.
void
setMessageListener(javax.jms.MessageListener messageListener)
API method.
String
toString()
Returns a string view of this consumer.

Field Details

closed

protected boolean closed
true if the consumer is closed.


dest

protected Destination dest
The destination the consumer gets its messages from.


noLocal

protected boolean noLocal
true if the subscriber does not wish to consume messages produced by its connection.

Method Details

close

public void close()
            throws JMSException
API method.


getMessageListener

public javax.jms.MessageListener getMessageListener()
            throws JMSException
API method.


getMessageSelector

public String getMessageSelector()
            throws JMSException
API method.


receive

public javax.jms.Message receive()
            throws JMSException
API method.


receive

public javax.jms.Message receive(long timeOut)
            throws JMSException
API method implemented in subclasses.


receiveNoWait

public javax.jms.Message receiveNoWait()
            throws JMSException
API method.


setMessageListener

public void setMessageListener(javax.jms.MessageListener messageListener)
            throws JMSException
API method.

This method must not be called if the connection the consumer belongs to is started, because the session would then be accessed by the thread calling this method and by the thread controlling asynchronous deliveries. This situation is clearly forbidden by the single threaded nature of sessions. Moreover, unsetting a message listener without stopping the connection may lead to the situation where asynchronous deliveries would arrive on the connection, the session or the consumer without being able to reach their target listener!


toString

public String toString()
Returns a string view of this consumer.


Copyright B) 2004 Scalagent - All rights reserved