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
JMSException
public boolean getNoLocal() throws JMSException
JMSException
public MessageListener getMessageListener() throws JMSException
getMessageListener
in interface MessageConsumer
JMSException
public void setMessageListener(MessageListener listener) throws JMSException
setMessageListener
in interface MessageConsumer
JMSException
public void setMessageListener(MessageListener listener, long pollInterval) throws JMSException
JMSException
public java.lang.String getMessageSelector() throws JMSException
getMessageSelector
in interface MessageConsumer
JMSException
public Selector getSelector()
public boolean isActive() throws JMSException
JMSException
public boolean isClosed()
public Message receive() throws JMSException
receive
in interface MessageConsumer
JMSException
public Message receiveNoWait() throws JMSException
receiveNoWait
in interface MessageConsumer
JMSException
public Message receive(long timeout) throws JMSException
receive
in interface MessageConsumer
JMSException
protected Message receiveImpl(long timeout) throws JMSException
JMSException
public boolean notifyMessageAvailable()
public void addMessageCallback()
public void start()
public void stop() throws JMSException
JMSException
public void close() throws JMSException
close
in interface MessageConsumer
JMSException
public java.lang.String toString()
toString
in class java.lang.Object