activemq-cpp-3.6.0
cms::XAConnectionFactory Class Reference

The XAConnectionFactory interface is specialized interface that defines an ConnectionFactory that creates Connection instance that will participate in XA Transactions. More...

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

Inheritance diagram for cms::XAConnectionFactory:

Public Member Functions

virtual ~XAConnectionFactory ()
virtual XAConnectioncreateXAConnection ()=0
 Creates an XAConnection with the default user name and password.
virtual XAConnectioncreateXAConnection (const std::string &userName, const std::string &password)=0
 Creates an XA connection with the specified user name and password.

Static Public Member Functions

static XAConnectionFactorycreateCMSXAConnectionFactory (const std::string &brokerURI)
 Static method that is used to create a provider specific XA Connection factory.

Detailed Description

The XAConnectionFactory interface is specialized interface that defines an ConnectionFactory that creates Connection instance that will participate in XA Transactions.

Some application provide support for grouping XA capable resource use into a distributed transaction (optional). To include CMS API transactions in a XA transaction, an application requires a XA aware library. A CMS provider exposes its XA support using an XAConnectionFactory object, which an application uses to create XAConnection objects.

The XAConnectionFactory interface is optional. CMS providers are not required to support this interface. This interface is for use by CMS providers to support transactional environments. Client programs are strongly encouraged to use the transactional support available in their environment, rather than use these XA interfaces directly.

Since
2.3

Constructor & Destructor Documentation

virtual cms::XAConnectionFactory::~XAConnectionFactory ( )
virtual

Member Function Documentation

static XAConnectionFactory* cms::XAConnectionFactory::createCMSXAConnectionFactory ( const std::string &  brokerURI)
static

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

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

The XA interfaces are optional in CMS however if a provider chooses to omit them it should still override this method and throw an UnsupportedOperationException to indicate that it doesn't provide this functionality.

Parameters
brokerURIThe remote address to use to connect to the Provider.
Returns
A pointer to a provider specific implementation of the XAConnectionFactory interface, the caller is responsible for deleting this resource.
Exceptions
CMSExceptionif an internal error occurs while creating the XAConnectionFactory.
UnsupportedOperationExceptionif the provider does not support the XA API.
virtual XAConnection* cms::XAConnectionFactory::createXAConnection ( )
pure virtual

Creates an XAConnection with the default user name and password.

The connection is created in stopped mode just as the standard Connection object is created from the ConnectionFactory. No messages will be delivered until the Connection.start method is explicitly called.

Returns
a new XAConnectionFactory instance, the caller owns the returned pointer.
Exceptions
CMSExceptionif an internal error occurs while creating the Connection.
CMSSecurityExceptionif the client authentication fails because the user name or password are invalid.

Implemented in activemq::core::ActiveMQXAConnectionFactory.

virtual XAConnection* cms::XAConnectionFactory::createXAConnection ( const std::string &  userName,
const std::string &  password 
)
pure virtual

Creates an XA connection with the specified user name and password.

The connection is created in stopped mode just as the standard ConnectionFactory creates a new Connection. No messages will be delivered until the Connection.start method is explicitly called.

Returns
a new XAConnectionFactory instance, the caller owns the returned pointer.
Exceptions
CMSExceptionif an internal error occurs while creating the Connection.
CMSSecurityExceptionif the client authentication fails because the user name or password are invalid.

Implemented in activemq::core::ActiveMQXAConnectionFactory.


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