Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 47728 invoked from network); 17 Nov 2010 20:35:53 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 Nov 2010 20:35:53 -0000 Received: (qmail 28324 invoked by uid 500); 17 Nov 2010 20:36:25 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 28301 invoked by uid 500); 17 Nov 2010 20:36:25 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 28294 invoked by uid 99); 17 Nov 2010 20:36:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Nov 2010 20:36:25 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Nov 2010 20:36:22 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E2AAB2388903; Wed, 17 Nov 2010 20:35:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1036207 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main: activemq/core/ActiveMQXAConnectionFactory.cpp cms/XAConnectionFactory.h Date: Wed, 17 Nov 2010 20:35:07 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101117203507.E2AAB2388903@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Wed Nov 17 20:35:07 2010 New Revision: 1036207 URL: http://svn.apache.org/viewvc?rev=1036207&view=rev Log: https://issues.apache.org/activemq/browse/AMQCPP-329 Adds a static entry point in cms::XAConnectionFactory to create new instances via the provider library. Allows a provider to throw an exception if the XA API is not supported. Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQXAConnectionFactory.cpp activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/XAConnectionFactory.h Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQXAConnectionFactory.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQXAConnectionFactory.cpp?rev=1036207&r1=1036206&r2=1036207&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQXAConnectionFactory.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQXAConnectionFactory.cpp Wed Nov 17 20:35:07 2010 @@ -23,6 +23,11 @@ using namespace activemq; using namespace activemq::core; //////////////////////////////////////////////////////////////////////////////// +cms::XAConnectionFactory* cms::XAConnectionFactory::createCMSXAConnectionFactory( const std::string& brokerURI ) { + return new ActiveMQXAConnectionFactory( brokerURI ); +} + +//////////////////////////////////////////////////////////////////////////////// ActiveMQXAConnectionFactory::ActiveMQXAConnectionFactory() : ActiveMQConnectionFactory() { } Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/XAConnectionFactory.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/XAConnectionFactory.h?rev=1036207&r1=1036206&r2=1036207&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/XAConnectionFactory.h (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/XAConnectionFactory.h Wed Nov 17 20:35:07 2010 @@ -75,6 +75,29 @@ namespace cms { */ virtual XAConnection* createXAConnection( const std::string& userName, const std::string& password ) = 0; + public: + + /** + * 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. + * + * @param brokerURI + * The remote address to use to connect to the Provider. + * + * @return A pointer to a provider specific implementation of the XAConnectionFactory + * interface, the caller is responsible for deleting this resource. + * + * @throws CMSException if an internal error occurs while creating the XAConnectionFactory. + * @throws UnsupportedOperationException if the provider does not support the XA API. + */ + static XAConnectionFactory* createCMSXAConnectionFactory( const std::string& brokerURI ); };