activemq::cmsutil::CachedConsumer Class Reference

A cached message consumer contained within a pooled session. More...

#include <src/main/activemq/cmsutil/CachedConsumer.h>

Inheritance diagram for activemq::cmsutil::CachedConsumer:
Inheritance graph
[legend]

Public Member Functions

 CachedConsumer (cms::MessageConsumer *consumer)
virtual ~CachedConsumer ()
virtual void close ()
 Does nothing - the real producer resource will be closed by the lifecycle manager.
virtual void start ()
 Starts the service.
virtual void stop ()
 Stops this service.
virtual cms::Messagereceive ()
 Synchronously Receive a Message.
virtual cms::Messagereceive (int millisecs)
 Synchronously Receive a Message, time out after defined interval.
virtual cms::MessagereceiveNoWait ()
 Receive a Message, does not wait if there isn't a new message to read, returns NULL if nothing read.
virtual void setMessageListener (cms::MessageListener *listener)
 Sets the MessageListener that this class will send notifs on.
virtual cms::MessageListenergetMessageListener () const
 Gets the MessageListener that this class will send mew Message notification events to.
virtual std::string getMessageSelector () const
 Gets this message consumer's message selector expression.
virtual void setMessageAvailableListener (cms::MessageAvailableListener *listener)
 Sets the MessageAvailableListener that this class will send events to if the consumer is in synchronous consumption mode and a new Message has arrived.
virtual
cms::MessageAvailableListener
getMessageAvailableListener () const
 Gets the MessageAvailableListener that this class will send mew Message notification events to.
virtual void setMessageTransformer (cms::MessageTransformer *transformer)
 Set an MessageTransformer instance that is applied to all cms::Message objects before they are dispatched to client code.
virtual cms::MessageTransformergetMessageTransformer () const
 Gets the currently configured MessageTransformer for this MessageConsumer.

Detailed Description

A cached message consumer contained within a pooled session.


Constructor & Destructor Documentation

activemq::cmsutil::CachedConsumer::CachedConsumer ( cms::MessageConsumer consumer  ) 
virtual activemq::cmsutil::CachedConsumer::~CachedConsumer (  )  [virtual]

Member Function Documentation

virtual void activemq::cmsutil::CachedConsumer::close (  )  [inline, virtual]

Does nothing - the real producer resource will be closed by the lifecycle manager.

Implements cms::Closeable.

virtual cms::MessageAvailableListener* activemq::cmsutil::CachedConsumer::getMessageAvailableListener (  )  const [inline, virtual]

Gets the MessageAvailableListener that this class will send mew Message notification events to.

Returns:
The listener of message events received by this consumer.
Exceptions:
CMSException - If an internal error occurs.

Implements cms::MessageConsumer.

References cms::MessageConsumer::getMessageAvailableListener().

virtual cms::MessageListener* activemq::cmsutil::CachedConsumer::getMessageListener (  )  const [inline, virtual]

Gets the MessageListener that this class will send mew Message notification events to.

Returns:
The listener of messages received by this consumer
Exceptions:
CMSException - If an internal error occurs.

Implements cms::MessageConsumer.

References cms::MessageConsumer::getMessageListener().

virtual std::string activemq::cmsutil::CachedConsumer::getMessageSelector (  )  const [inline, virtual]

Gets this message consumer's message selector expression.

Returns:
This Consumer's selector expression or "".
Exceptions:
CMSException - If an internal error occurs.

Implements cms::MessageConsumer.

References cms::MessageConsumer::getMessageSelector().

virtual cms::MessageTransformer* activemq::cmsutil::CachedConsumer::getMessageTransformer (  )  const [inline, virtual]

Gets the currently configured MessageTransformer for this MessageConsumer.

Returns:
the pointer to the currently set cms::MessageTransformer.

Implements cms::MessageConsumer.

References cms::MessageConsumer::getMessageTransformer().

virtual cms::Message* activemq::cmsutil::CachedConsumer::receive ( int  millisecs  )  [inline, virtual]

Synchronously Receive a Message, time out after defined interval.

Returns null if nothing read.

Returns:
new message which the caller owns and must delete.
Exceptions:
CMSException - If an internal error occurs.

Implements cms::MessageConsumer.

References cms::MessageConsumer::receive().

virtual cms::Message* activemq::cmsutil::CachedConsumer::receive (  )  [inline, virtual]

Synchronously Receive a Message.

Returns:
new message which the caller owns and must delete.
Exceptions:
CMSException - If an internal error occurs.

Implements cms::MessageConsumer.

References cms::MessageConsumer::receive().

virtual cms::Message* activemq::cmsutil::CachedConsumer::receiveNoWait (  )  [inline, virtual]

Receive a Message, does not wait if there isn't a new message to read, returns NULL if nothing read.

Returns:
new message which the caller owns and must delete.
Exceptions:
CMSException - If an internal error occurs.

Implements cms::MessageConsumer.

References cms::MessageConsumer::receiveNoWait().

virtual void activemq::cmsutil::CachedConsumer::setMessageAvailableListener ( cms::MessageAvailableListener listener  )  [inline, virtual]

Sets the MessageAvailableListener that this class will send events to if the consumer is in synchronous consumption mode and a new Message has arrived.

Parameters:
listener The listener of new message events fired by this consumer.
Exceptions:
CMSException - If an internal error occurs.

Implements cms::MessageConsumer.

References cms::MessageConsumer::setMessageAvailableListener().

virtual void activemq::cmsutil::CachedConsumer::setMessageListener ( cms::MessageListener listener  )  [inline, virtual]

Sets the MessageListener that this class will send notifs on.

Parameters:
listener The listener of messages received by this consumer.
Exceptions:
CMSException - If an internal error occurs.

Implements cms::MessageConsumer.

References cms::MessageConsumer::setMessageListener().

virtual void activemq::cmsutil::CachedConsumer::setMessageTransformer ( cms::MessageTransformer transformer  )  [inline, virtual]

Set an MessageTransformer instance that is applied to all cms::Message objects before they are dispatched to client code.

The CMS code never takes ownership of the MessageTransformer pointer which implies that the client code must ensure that the object remains valid for the lifetime of the CMS object to which the MessageTransformer has been assigned.

Parameters:
transformer Pointer to the cms::MessageTransformer to apply on each cms:;Message dispatch.

Implements cms::MessageConsumer.

References cms::MessageConsumer::setMessageTransformer().

virtual void activemq::cmsutil::CachedConsumer::start (  )  [inline, virtual]

Starts the service.

Exceptions:
CMSException if an internal error occurs while starting.

Implements cms::Startable.

References cms::Startable::start().

virtual void activemq::cmsutil::CachedConsumer::stop (  )  [inline, virtual]

Stops this service.

Exceptions:
CMSException - if an internal error occurs while stopping the Service.

Implements cms::Stoppable.

References cms::Stoppable::stop().


The documentation for this class was generated from the following file:

Generated on 1 Dec 2014 for activemq-cpp-3.8.2 by  doxygen 1.6.1