activemq-cpp-3.6.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 ()
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, AsyncCallback *onComplete)=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 (Message *message, int deliveryMode, int priority, long long timeToLive, AsyncCallback *onComplete)=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, AsyncCallback *onComplete)=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 send (const Destination *destination, Message *message, int deliveryMode, int priority, long long timeToLive, AsyncCallback *onComplete)=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.
virtual void setMessageTransformer (cms::MessageTransformer *transformer)=0
 Set an MessageTransformer instance that is applied to all cms::Message objects before they are sent on to the CMS bus.
virtual cms::MessageTransformergetMessageTransformer () const =0
 Gets the currently configured MessageTransformer for this MessageProducer.
- Public Member Functions inherited from cms::Closeable
virtual ~Closeable ()
virtual void close ()=0
 Closes this object and deallocates the appropriate resources.

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 ( )
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::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.

Referenced by activemq::cmsutil::CachedProducer::getDeliveryMode().

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::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.

Referenced by activemq::cmsutil::CachedProducer::getDisableMessageID().

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::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.

Referenced by activemq::cmsutil::CachedProducer::getDisableMessageTimeStamp().

virtual cms::MessageTransformer* cms::MessageProducer::getMessageTransformer ( ) const
pure virtual
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::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.

Referenced by activemq::cmsutil::CachedProducer::getPriority().

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::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.

Referenced by activemq::cmsutil::CachedProducer::getTimeToLive().

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::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.

Referenced by activemq::cmsutil::CachedProducer::send().

virtual void cms::MessageProducer::send ( Message message,
AsyncCallback onComplete 
)
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. If the AsyncCallback parameter is set this method will return immediately and the call-back will be notified once the CMS Provider as acknowledge receipt of the Message or an Error occurs.

Parameters
messageThe message to be sent.
onCompleteThe AsyncCallback instance to notify on send complete or error, caller retains ownership of this pointer and must destroy it only after the send completes or the connection is closed.
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::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.

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::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.

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

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

If the AsyncCallback parameter is set this method will return immediately and the call-back will be notified once the CMS Provider as acknowledge receipt of the Message or an Error occurs.

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.
onCompleteThe AsyncCallback instance to notify on send complete or error, caller retains ownership of this pointer and must destroy it only after the send completes or the connection is closed.
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::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.

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::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.

virtual void cms::MessageProducer::send ( const Destination destination,
Message message,
AsyncCallback onComplete 
)
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. If the AsyncCallback parameter is set this method will return immediately and the call-back will be notified once the CMS Provider as acknowledge receipt of the Message or an Error occurs.

Parameters
destinationThe destination on which to send the message
messagethe message to be sent.
onCompleteThe AsyncCallback instance to notify on send complete or error, caller retains ownership of this pointer and must destroy it only after the send completes or the connection is closed.
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::core::kernels::ActiveMQProducerKernel, 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::core::kernels::ActiveMQProducerKernel, activemq::cmsutil::CachedProducer, and activemq::core::ActiveMQProducer.

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

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

If the AsyncCallback parameter is set this method will return immediately and the call-back will be notified once the CMS Provider as acknowledge receipt of the Message or an Error occurs.

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.
onCompleteThe AsyncCallback instance to notify on send complete or error, caller retains ownership of this pointer and must destroy it only after the send completes or the connection is closed.
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::core::kernels::ActiveMQProducerKernel, 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::core::kernels::ActiveMQProducerKernel, activemq::cmsutil::CachedProducer, and activemq::core::ActiveMQProducer.

Referenced by activemq::cmsutil::CachedProducer::setDeliveryMode().

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::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.

Referenced by activemq::cmsutil::CachedProducer::setDisableMessageID().

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::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.

Referenced by activemq::cmsutil::CachedProducer::setDisableMessageTimeStamp().

virtual void cms::MessageProducer::setMessageTransformer ( cms::MessageTransformer transformer)
pure virtual

Set an MessageTransformer instance that is applied to all cms::Message objects before they are sent on to the CMS bus.

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
transformerPointer to the cms::MessageTransformer to apply on each cms:;MessageSend.

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

Referenced by activemq::cmsutil::CachedProducer::setMessageTransformer().

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::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.

Referenced by activemq::cmsutil::CachedProducer::setPriority().

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::core::kernels::ActiveMQProducerKernel, activemq::core::ActiveMQProducer, and activemq::cmsutil::CachedProducer.

Referenced by activemq::cmsutil::CachedProducer::setTimeToLive().


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