activemq-cpp-3.4.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 () throw ()
virtual 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.

Static Public Member Functions

static 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 ( ) throw () [virtual]

Member Function Documentation

static 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 ( 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 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.


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