public class MessageConsumerImpl<E> extends java.lang.Object implements MessageConsumer
| Modifier and Type | Field and Description |
|---|---|
protected Selector |
_selector |
protected JmsSession |
_session |
| Modifier and Type | Method and Description |
|---|---|
void |
addMessageCallback() |
void |
close()
Closes the consumer.
|
protected AbstractDestination<E> |
getDestination()
Returns the destination
|
MessageListener |
getMessageListener()
Returns the message listener
|
java.lang.String |
getMessageSelector()
Returns the message consumer's selector.
|
boolean |
getNoLocal()
Returns true if local messages are not sent.
|
Selector |
getSelector()
Returns the parsed selector.
|
boolean |
isActive()
Returns true if active
|
boolean |
isClosed()
Returns true if closed
|
boolean |
notifyMessageAvailable()
Notifies that a message is available.
|
Message |
receive()
Receives the next message, blocking until a message is available.
|
Message |
receive(long timeout)
Receives a message from the queue.
|
protected Message |
receiveImpl(long timeout)
Receives a message from the queue.
|
Message |
receiveNoWait()
Receives a message from the queue.
|
void |
setMessageListener(MessageListener listener)
Sets the message listener
|
void |
setMessageListener(MessageListener listener,
long pollInterval)
Sets the message listener with a poll interval
|
void |
start()
Starts the consumer
|
void |
stop()
Stops the consumer.
|
java.lang.String |
toString() |
protected final JmsSession _session
protected Selector _selector
protected AbstractDestination<E> getDestination() throws JMSException
JMSExceptionpublic boolean getNoLocal()
throws JMSException
JMSExceptionpublic MessageListener getMessageListener() throws JMSException
getMessageListener in interface MessageConsumerJMSExceptionpublic void setMessageListener(MessageListener listener) throws JMSException
setMessageListener in interface MessageConsumerJMSExceptionpublic void setMessageListener(MessageListener listener, long pollInterval) throws JMSException
JMSExceptionpublic java.lang.String getMessageSelector()
throws JMSException
getMessageSelector in interface MessageConsumerJMSExceptionpublic Selector getSelector()
public boolean isActive()
throws JMSException
JMSExceptionpublic boolean isClosed()
public Message receive() throws JMSException
receive in interface MessageConsumerJMSExceptionpublic Message receiveNoWait() throws JMSException
receiveNoWait in interface MessageConsumerJMSExceptionpublic Message receive(long timeout) throws JMSException
receive in interface MessageConsumerJMSExceptionprotected Message receiveImpl(long timeout) throws JMSException
JMSExceptionpublic boolean notifyMessageAvailable()
public void addMessageCallback()
public void start()
public void stop()
throws JMSException
JMSExceptionpublic void close()
throws JMSException
close in interface MessageConsumerJMSExceptionpublic java.lang.String toString()
toString in class java.lang.Object