#include <ActiveMQConsumer.h>
Inheritance diagram for activemq::core::ActiveMQConsumer:
Public Member Functions | |
ActiveMQConsumer (connector::ConsumerInfo *consumerInfo, ActiveMQSession *session) | |
virtual | ~ActiveMQConsumer (void) |
virtual cms::Message * | receive (void) throw ( cms::CMSException ) |
virtual cms::Message * | receive (int millisecs) throw ( cms::CMSException ) |
virtual cms::Message * | receiveNoWait (void) throw ( cms::CMSException ) |
virtual void | setMessageListener (cms::MessageListener *listener) |
virtual cms::MessageListener * | getMessageListener (void) const |
virtual std::string | getMessageSelector (void) const throw ( cms::CMSException ) |
virtual void | acknowledgeMessage (const ActiveMQMessage *message) throw ( cms::CMSException ) |
virtual void | run (void) |
virtual void | onActiveMQMessage (ActiveMQMessage *message) throw ( exceptions::ActiveMQException ) |
virtual connector::ConnectorResource * | getConnectorResource (void) |
virtual void | dispatch (ActiveMQMessage *message) throw ( cms::CMSException ) |
virtual connector::ConsumerInfo * | getConsumerInfo (void) |
Protected Member Functions | |
virtual void | purgeMessages (void) |
virtual void | destroyMessage (cms::Message *message) |
void | notifyListener (cms::Message *message) |
void | startThread () |
void | stopThread () |
Private Attributes | |
ActiveMQSession * | session |
connector::ConsumerInfo * | consumerInfo |
cms::MessageListener * | listener |
concurrent::Mutex | listenerLock |
util::Queue< cms::Message * > | msgQueue |
concurrent::Thread * | listenerThread |
bool | shutdown |
|
Constructor |
|
|
|
Method called to acknowledge the message passed
Implements activemq::core::ActiveMQAckHandler. |
|
Destroys the message if the session is transacted, otherwise does nothing.
|
|
Called to dispatch a message to this consumer, this is usually called from the context of another thread. This will enqueue a message on the Consumers Queue, or notify a listener if one is currently registered.
|
|
Retrieve the Connector resource that is associated with this Session resource.
Implements activemq::core::ActiveMQSessionResource. |
|
Get the Consumer information for this consumer
|
|
Gets the MessageListener that this class will send notifs on
|
|
Gets this message consumer's message selector expression.
|
|
Notifies the listener of a message.
|
|
Called asynchronously when a new message is received, the message that is passed is now the property of the callee, and the caller will disavowe all knowledge of the message, i.e Callee must delete.
Implements activemq::core::ActiveMQMessageListener. |
|
Purges all messages currently in the queue. This can be as a result of a rollback, or of the consumer being shutdown. |
|
Synchronously Receive a Message, time out after defined interval. Returns null if nothing read.
|
|
Synchronously Receive a Message
|
|
Receive a Message, does not wait if there isn't a new message to read, returns NULL if nothing read.
|
|
Run method that is called from the Thread class when this object is registered with a Thread and started. This function reads from the message queue and dispatches calls to the MessageConsumer that is registered with this class. It is a error for a MessageListener to throw an exception in their onMessage method, but if it does happen this function will get any registered exception listener from the session and notify it. Implements activemq::concurrent::Runnable. |
|
Sets the MessageListener that this class will send notifs on
|
|
Starts the message processing thread to receive messages asynchronously. This thread is started when setMessageListener is invoked, which means that the caller is choosing to use this consumer asynchronously instead of synchronously (receive). |
|
Stops the asynchronous message processing thread if it's started. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|