activemq-cpp-3.6.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 () |
virtual cms::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. | |
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::ExceptionListener * | getExceptionListener () 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::MessageTransformer * | getMessageTransformer () const =0 |
Gets the currently configured MessageTransformer for this ConnectionFactory. |
Static Public Member Functions | |
static cms::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 |
|
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. |
|
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.
|
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.
|
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.
|
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.
Implemented in activemq::core::ActiveMQConnectionFactory.
|
pure virtual |
Gets the currently configured MessageTransformer for this ConnectionFactory.
Implemented in activemq::core::ActiveMQConnectionFactory.
|
pure virtual |
Set an ExceptionListener instance that is passed on to all Connection objects created from this ConnectionFactory.
transformer | Pointer to the cms::ExceptionListener to set on all newly created Connection objects/ |
Implemented in activemq::core::ActiveMQConnectionFactory.
|
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.
transformer | Pointer to the cms::MessageTransformer to set on all newly created Connection objects. |
Implemented in activemq::core::ActiveMQConnectionFactory.