activemq-cpp-3.6.0
cms::MessageTransformer Class Reference

Provides an interface for clients to transform cms::Message objects inside the CMS MessageProducer and MessageConsumer objects before the message's are sent or received. More...

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

Public Member Functions

virtual ~MessageTransformer ()
virtual bool producerTransform (cms::Session *session, cms::MessageProducer *producer, cms::Message *message, cms::Message **transformed)=0
 Transforms the given message inside the producer before it is sent to the CMS bus.
virtual bool consumerTransform (cms::Session *session, cms::MessageConsumer *consumer, cms::Message *message, cms::Message **transformed)=0
 Transforms the given message inside the consumer before it is dispatched to the client code.

Detailed Description

Provides an interface for clients to transform cms::Message objects inside the CMS MessageProducer and MessageConsumer objects before the message's are sent or received.

Since
3.0

Constructor & Destructor Documentation

virtual cms::MessageTransformer::~MessageTransformer ( )
virtual

Member Function Documentation

virtual bool cms::MessageTransformer::consumerTransform ( cms::Session session,
cms::MessageConsumer consumer,
cms::Message message,
cms::Message **  transformed 
)
pure virtual

Transforms the given message inside the consumer before it is dispatched to the client code.

The contract of this method is that the resulting transformed message pointer is set if and only if the method actually creates a new cms::Message object, otherwise it must always be set to NULL. The return value indicates whether a transformation took place and indicates that the resulting transformed cms::Message pointer will need to be deleted once the consumer completed message dispatch.

Parameters
sessionThe Session used to create the target MessageConsumer for this transformation.
consumerThe MessageConsumer instance that is going to handle dispatching the transformed Message.
messageThe CMS Message object that is to be transformed by this method.
transformedA pointer to the location in memory where the newly transformed Message has been allocated.
Returns
true if the MessageConsumer should handle deleting the transformed Message once sent.
Exceptions
cms::CMSExceptionif an error occurs during the transform operation.
virtual bool cms::MessageTransformer::producerTransform ( cms::Session session,
cms::MessageProducer producer,
cms::Message message,
cms::Message **  transformed 
)
pure virtual

Transforms the given message inside the producer before it is sent to the CMS bus.

The contract of this method is that the resulting transformed message pointer is set if and only if the method actually creates a new cms::Message object, otherwise it must always be set to NULL. The return value indicates whether a transformation took place and indicates that the resulting transformed cms::Message pointer will need to be deleted once the producer has sent the cms::Message on to the CMS bus.

Parameters
sessionThe Session used to create the target MessageProducer for this transformation.
producerThe MessageProducer instance that is going to handle sending the transformed Message.
messageThe CMS Message object that is to be transformed by this method.
transformedA pointer to the location in memory where the newly transformed Message has been allocated.
Returns
true if the MessageProducer should handle deleting the transformed Message once sent.
Exceptions
cms::CMSExceptionif an error occurs during the transform operation.

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