activemq-cpp-3.4.0

cms::MessageProducer Class Reference

A client uses a MessageProducer object to send messages to a Destination. More...

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

Inheritance diagram for cms::MessageProducer:

Public Member Functions

virtual ~MessageProducer () throw ()
virtual void send (Message *message)=0
 Sends the message to the default producer destination, but does not take ownership of the message, caller must still destroy it.
virtual void send (Message *message, int deliveryMode, int priority, long long timeToLive)=0
 Sends the message to the default producer destination, but does not take ownership of the message, caller must still destroy it.
virtual void send (const Destination *destination, Message *message)=0
 Sends the message to the designated destination, but does not take ownership of the message, caller must still destroy it.
virtual void send (const Destination *destination, Message *message, int deliveryMode, int priority, long long timeToLive)=0
 Sends the message to the designated destination, but does not take ownership of the message, caller must still destroy it.
virtual void setDeliveryMode (int mode)=0
 Sets the delivery mode for this Producer.
virtual int getDeliveryMode () const =0
 Gets the delivery mode for this Producer.
virtual void setDisableMessageID (bool value)=0
 Sets if Message Ids are disabled for this Producer.
virtual bool getDisableMessageID () const =0
 Gets if Message Ids are disabled for this Producer.
virtual void setDisableMessageTimeStamp (bool value)=0
 Sets if Message Time Stamps are disabled for this Producer.
virtual bool getDisableMessageTimeStamp () const =0
 Gets if Message Time Stamps are disabled for this Producer.
virtual void setPriority (int priority)=0
 Sets the Priority that this Producers sends messages at.
virtual int getPriority () const =0
 Gets the Priority level that this producer sends messages at.
virtual void setTimeToLive (long long time)=0
 Sets the Time to Live that this Producers sends messages with.
virtual long long getTimeToLive () const =0
 Gets the Time to Live that this producer sends messages with.

Detailed Description

A client uses a MessageProducer object to send messages to a Destination.

A MessageProducer object is created by passing a Destination object to a message-producer creation method supplied by a session.

A client also has the option of creating a message producer without supplying a destination. In this case, a Destination must be provided with every send operation. A typical use for this kind of message producer is to send replies to requests using the request's CMSReplyTo destination.

A client can specify a default delivery mode, priority, and time to live for messages sent by a message producer. It can also specify the delivery mode, priority, and time to live for an individual message.

A client can specify a time-to-live value in milliseconds for each message it sends. This value defines a message expiration time that is the sum of the message's time-to-live and the GMT when it is sent (for transacted sends, this is the time the client sends the message, not the time the transaction is committed).

Since:
1.0

Constructor & Destructor Documentation

virtual cms::MessageProducer::~MessageProducer ( ) throw () [virtual]

Member Function Documentation

virtual int cms::MessageProducer::getDeliveryMode ( ) const [pure virtual]

Gets the delivery mode for this Producer.

Returns:
The DeliveryMode
Exceptions:
CMSException- if an internal error occurs.

Implemented in activemq::cmsutil::CachedProducer, and activemq::core::ActiveMQProducer.

virtual bool cms::MessageProducer::getDisableMessageID ( ) const [pure virtual]

Gets if Message Ids are disabled for this Producer.

Returns:
boolean indicating enable / disable (true / false)
Exceptions:
CMSException- if an internal error occurs.

Implemented in activemq::cmsutil::CachedProducer, and activemq::core::ActiveMQProducer.

virtual bool cms::MessageProducer::getDisableMessageTimeStamp ( ) const [pure virtual]

Gets if Message Time Stamps are disabled for this Producer.

Returns:
boolean indicating enable / disable (true / false)
Exceptions:
CMSException- if an internal error occurs.

Implemented in activemq::cmsutil::CachedProducer, and activemq::core::ActiveMQProducer.

virtual int cms::MessageProducer::getPriority ( ) const [pure virtual]

Gets the Priority level that this producer sends messages at.

Returns:
int based priority level
Exceptions:
CMSException- if an internal error occurs.

Implemented in activemq::cmsutil::CachedProducer, and activemq::core::ActiveMQProducer.

virtual long long cms::MessageProducer::getTimeToLive ( ) const [pure virtual]

Gets the Time to Live that this producer sends messages with.

Returns:
Time to live value in milliseconds
Exceptions:
CMSException- if an internal error occurs.

Implemented in activemq::cmsutil::CachedProducer, and activemq::core::ActiveMQProducer.

virtual void cms::MessageProducer::send ( Message message,
int  deliveryMode,
int  priority,
long long  timeToLive 
) [pure virtual]

Sends the message to the default producer destination, but does not take ownership of the message, caller must still destroy it.

Parameters:
messageThe message to be sent.
deliveryModeThe delivery mode to be used.
priorityThe priority for this message.
timeToLiveThe time to live value for this message in milliseconds.
Exceptions:
CMSException- if an internal error occurs while sending the message.
MessageFormatException- if an Invalid Message is given.
InvalidDestinationException- if a client uses this method with a MessageProducer with an invalid destination.
UnsupportedOperationException- if a client uses this method with a MessageProducer that did not specify a destination at creation time.

Implemented in activemq::cmsutil::CachedProducer, and activemq::core::ActiveMQProducer.

virtual void cms::MessageProducer::send ( const Destination destination,
Message message,
int  deliveryMode,
int  priority,
long long  timeToLive 
) [pure virtual]

Sends the message to the designated destination, but does not take ownership of the message, caller must still destroy it.

Parameters:
destinationThe destination on which to send the message
messageThe message to be sent.
deliveryModeThe delivery mode to be used.
priorityThe priority for this message.
timeToLiveThe time to live value for this message in milliseconds.
Exceptions:
CMSException- if an internal error occurs while sending the message.
MessageFormatException- if an Invalid Message is given.
InvalidDestinationException- if a client uses this method with a MessageProducer with an invalid destination.
UnsupportedOperationException- if a client uses this method with a MessageProducer that did not specify a destination at creation time.

Implemented in activemq::cmsutil::CachedProducer, and activemq::core::ActiveMQProducer.

virtual void cms::MessageProducer::send ( Message message) [pure virtual]

Sends the message to the default producer destination, but does not take ownership of the message, caller must still destroy it.

Uses default values for deliveryMode, priority, and time to live.

Parameters:
messageThe message to be sent.
Exceptions:
CMSException- if an internal error occurs while sending the message.
MessageFormatException- if an Invalid Message is given.
InvalidDestinationException- if a client uses this method with a MessageProducer with an invalid destination.
UnsupportedOperationException- if a client uses this method with a MessageProducer that did not specify a destination at creation time.

Implemented in activemq::cmsutil::CachedProducer, and activemq::core::ActiveMQProducer.

virtual void cms::MessageProducer::send ( const Destination destination,
Message message 
) [pure virtual]

Sends the message to the designated destination, but does not take ownership of the message, caller must still destroy it.

Uses default values for deliveryMode, priority, and time to live.

Parameters:
destinationThe destination on which to send the message
messagethe message to be sent.
Exceptions:
CMSException- if an internal error occurs while sending the message.
MessageFormatException- if an Invalid Message is given.
InvalidDestinationException- if a client uses this method with a MessageProducer with an invalid destination.
UnsupportedOperationException- if a client uses this method with a MessageProducer that did not specify a destination at creation time.

Implemented in activemq::cmsutil::CachedProducer, and activemq::core::ActiveMQProducer.

virtual void cms::MessageProducer::setDeliveryMode ( int  mode) [pure virtual]

Sets the delivery mode for this Producer.

Parameters:
modeThe DeliveryMode
Exceptions:
CMSException- if an internal error occurs.

Implemented in activemq::cmsutil::CachedProducer, and activemq::core::ActiveMQProducer.

virtual void cms::MessageProducer::setDisableMessageID ( bool  value) [pure virtual]

Sets if Message Ids are disabled for this Producer.

Parameters:
valueboolean indicating enable / disable (true / false)
Exceptions:
CMSException- if an internal error occurs.

Implemented in activemq::cmsutil::CachedProducer, and activemq::core::ActiveMQProducer.

virtual void cms::MessageProducer::setDisableMessageTimeStamp ( bool  value) [pure virtual]

Sets if Message Time Stamps are disabled for this Producer.

Parameters:
value- boolean indicating enable / disable (true / false)
Exceptions:
CMSException- if an internal error occurs.

Implemented in activemq::cmsutil::CachedProducer, and activemq::core::ActiveMQProducer.

virtual void cms::MessageProducer::setPriority ( int  priority) [pure virtual]

Sets the Priority that this Producers sends messages at.

Parameters:
priorityint value for Priority level
Exceptions:
CMSException- if an internal error occurs.

Implemented in activemq::cmsutil::CachedProducer, and activemq::core::ActiveMQProducer.

virtual void cms::MessageProducer::setTimeToLive ( long long  time) [pure virtual]

Sets the Time to Live that this Producers sends messages with.

This value will be used if the time to live is not specified via the send method.

Parameters:
timedefault time to live value in milliseconds
Exceptions:
CMSException- if an internal error occurs.

Implemented in activemq::cmsutil::CachedProducer, and activemq::core::ActiveMQProducer.


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