cms::MessageConsumer Class Reference

#include <src/main/cms/MessageConsumer.h>

Inheritance diagram for cms::MessageConsumer:

Inheritance graph
[legend]
Collaboration diagram for cms::MessageConsumer:

Collaboration graph
[legend]

Detailed Description

A client uses a MessageConsumer to received messages from a destination.



A client may either synchronously receive a message consumer's messages or have the consumer asynchronously deliver them as they arrive.

For synchronous receipt, a client can request the next message from a message consumer using one of its receive methods. There are several variations of receive that allow a client to poll or wait for the next message.

For asynchronous delivery, a client can register a MessageListener object with a message consumer. As messages arrive at the message consumer, it delivers them by calling the MessageListener's onMessage method.

See also:
MessageListener

Public Member Functions

virtual ~MessageConsumer ()
virtual Messagereceive ()=0 throw ( CMSException )
 Synchronously Receive a Message.
virtual Messagereceive (int millisecs)=0 throw ( CMSException )
 Synchronously Receive a Message, time out after defined interval.
virtual MessagereceiveNoWait ()=0 throw ( CMSException )
 Receive a Message, does not wait if there isn't a new message to read, returns NULL if nothing read.
virtual void setMessageListener (MessageListener *listener)=0
 Sets the MessageListener that this class will send notifs on.
virtual MessageListenergetMessageListener () const =0
 Gets the MessageListener that this class will send notifs on.
virtual std::string getMessageSelector () const =0 throw ( cms::CMSException )
 Gets this message consumer's message selector expression.

Constructor & Destructor Documentation

virtual cms::MessageConsumer::~MessageConsumer (  )  [inline, virtual]


Member Function Documentation

virtual Message* cms::MessageConsumer::receive (  )  throw ( CMSException ) [pure virtual]

Synchronously Receive a Message.

Returns:
new message
Exceptions:
CMSException 

virtual Message* cms::MessageConsumer::receive ( int  millisecs  )  throw ( CMSException ) [pure virtual]

Synchronously Receive a Message, time out after defined interval.

Returns null if nothing read.

Returns:
new message
Exceptions:
CMSException 

virtual Message* cms::MessageConsumer::receiveNoWait (  )  throw ( CMSException ) [pure virtual]

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

Returns:
new message
Exceptions:
CMSException 

virtual void cms::MessageConsumer::setMessageListener ( MessageListener listener  )  [pure virtual]

Sets the MessageListener that this class will send notifs on.

Parameters:
listener The listener of messages received by this consumer.

virtual MessageListener* cms::MessageConsumer::getMessageListener (  )  const [pure virtual]

Gets the MessageListener that this class will send notifs on.

Returns:
The listener of messages received by this consumer

virtual std::string cms::MessageConsumer::getMessageSelector (  )  const throw ( cms::CMSException ) [pure virtual]

Gets this message consumer's message selector expression.

Returns:
This Consumer's selector expression or "".
Exceptions:
cms::CMSException 


The documentation for this class was generated from the following file:
Generated on Sat Oct 27 16:57:01 2007 for cms-1.2 by  doxygen 1.5.3