activemq-cpp-3.4.0
|
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>
Public Member Functions | |
virtual | ~ConnectionFactory () throw () |
virtual Connection * | createConnection ()=0 |
Creates a connection with the default user identity. | |
virtual cms::Connection * | createConnection (const std::string &username, const std::string &password)=0 |
Creates a connection with the default specified identity. | |
virtual cms::Connection * | createConnection (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 ConnectionFactory * | createCMSConnectionFactory (const std::string &brokerURI) |
Static method that is used to create a provider specific connection factory. |
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.
virtual cms::ConnectionFactory::~ConnectionFactory | ( | ) | throw () [virtual] |
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.
brokerURI | The remote address to use to connect to the Provider. |
CMSException | if 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.
username | The user name used to authenticate with the Provider. |
password | The password used to authenticate with the Provider. |
CMSException | if 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.
username | The user name used to authenticate with the Provider. |
password | The password used to authenticate with the Provider. |
clientId | The Client Id assigned to connection. If the id is the empty string ("") then a random client Id is created for this connection. |
CMSException | if 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.
CMSException | if an internal error occurs while creating the Connection. |
Implemented in activemq::core::ActiveMQConnectionFactory.