activemq-cpp-3.6.0
cms::ConnectionFactory Class Reference

Defines the interface for a factory that creates connection objects, the Connection objects returned implement the CMS Connection interface and hide the CMS Provider specific implementation details behind that interface. More...

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

Inheritance diagram for cms::ConnectionFactory:

Public Member Functions

virtual ~ConnectionFactory ()
virtual cms::ConnectioncreateConnection ()=0
 Creates a connection with the default user identity.
virtual cms::ConnectioncreateConnection (const std::string &username, const std::string &password)=0
 Creates a connection with the default specified identity.
virtual cms::ConnectioncreateConnection (const std::string &username, const std::string &password, const std::string &clientId)=0
 Creates a connection with the specified user identity.
virtual void setExceptionListener (cms::ExceptionListener *listener)=0
 Set an ExceptionListener instance that is passed on to all Connection objects created from this ConnectionFactory.
virtual cms::ExceptionListenergetExceptionListener () const =0
 Gets the currently configured ExceptionListener for this ConnectionFactory.
virtual void setMessageTransformer (cms::MessageTransformer *transformer)=0
 Set an MessageTransformer instance that is passed on to all Connection objects created from this ConnectionFactory.
virtual cms::MessageTransformergetMessageTransformer () const =0
 Gets the currently configured MessageTransformer for this ConnectionFactory.

Static Public Member Functions

static cms::ConnectionFactorycreateCMSConnectionFactory (const std::string &brokerURI)
 Static method that is used to create a provider specific connection factory.

Detailed Description

Defines the interface for a factory that creates connection objects, the Connection objects returned implement the CMS Connection interface and hide the CMS Provider specific implementation details behind that interface.

A Client creates a new ConnectionFactory either directly by instantiating the provider specific implementation of the factory or by using the static method createCMSConnectionFactory which all providers are required to implement.

Since
1.0

Constructor & Destructor Documentation

virtual cms::ConnectionFactory::~ConnectionFactory ( )
virtual

Member Function Documentation

static cms::ConnectionFactory* cms::ConnectionFactory::createCMSConnectionFactory ( const std::string &  brokerURI)
static

Static method that is used to create a provider specific connection factory.

The provider implements this method in their library and returns an instance of a ConnectionFactory derived object. Clients can use this method to remain abstracted from the specific CMS implementation being used.

Parameters
brokerURIThe remote address to use to connect to the Provider.
Returns
A pointer to a provider specific implementation of the ConnectionFactory interface, the caller is responsible for deleting this resource.
Exceptions
CMSExceptionif an internal error occurs while creating the ConnectionFactory.
virtual cms::Connection* cms::ConnectionFactory::createConnection ( )
pure virtual

Creates a connection with the default user identity.

The connection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Returns
A pointer to a connection object, caller owns the pointer and is responsible for closing the connection and deleting the instance.
Exceptions
CMSExceptionif an internal error occurs while creating the Connection.

Implemented in activemq::core::ActiveMQConnectionFactory.

virtual cms::Connection* cms::ConnectionFactory::createConnection ( const std::string &  username,
const std::string &  password 
)
pure virtual

Creates a connection with the default specified identity.

The connection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called. The username and password values passed here do not change the defaults, subsequent calls to the parameterless createConnection will continue to use the default values that were set in the Constructor.

Parameters
usernameThe user name used to authenticate with the Provider.
passwordThe password used to authenticate with the Provider.
Returns
A pointer to a connection object, caller owns the pointer and is responsible for closing the connection and deleting the instance.
Exceptions
CMSExceptionif an internal error occurs while creating the Connection.

Implemented in activemq::core::ActiveMQConnectionFactory.

virtual cms::Connection* cms::ConnectionFactory::createConnection ( const std::string &  username,
const std::string &  password,
const std::string &  clientId 
)
pure virtual

Creates a connection with the specified user identity.

The connection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called. The user name and password values passed here do not change the defaults, subsequent calls to the parameterless createConnection will continue to use the default values that were set in the Constructor.

Parameters
usernameThe user name used to authenticate with the Provider.
passwordThe password used to authenticate with the Provider.
clientIdThe Client Id assigned to connection. If the id is the empty string ("") then a random client Id is created for this connection.
Returns
A pointer to a connection object, caller owns the pointer and is responsible for closing the connection and deleting the instance.
Exceptions
CMSExceptionif an internal error occurs while creating the Connection.

Implemented in activemq::core::ActiveMQConnectionFactory.

virtual cms::ExceptionListener* cms::ConnectionFactory::getExceptionListener ( ) const
pure virtual

Gets the currently configured ExceptionListener for this ConnectionFactory.

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

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

Implemented in activemq::core::ActiveMQConnectionFactory.

virtual cms::MessageTransformer* cms::ConnectionFactory::getMessageTransformer ( ) const
pure virtual

Gets the currently configured MessageTransformer for this ConnectionFactory.

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

Implemented in activemq::core::ActiveMQConnectionFactory.

virtual void cms::ConnectionFactory::setExceptionListener ( cms::ExceptionListener listener)
pure virtual

Set an ExceptionListener instance that is passed on to all Connection objects created from this ConnectionFactory.

Parameters
transformerPointer to the cms::ExceptionListener to set on all newly created Connection objects/

Implemented in activemq::core::ActiveMQConnectionFactory.

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

Set an MessageTransformer instance that is passed on to all Connection objects created from this ConnectionFactory.

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 set on all newly created Connection objects.

Implemented in activemq::core::ActiveMQConnectionFactory.


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