You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2010/11/15 00:26:08 UTC

svn commit: r1035100 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms: TransactionInProgressException.cpp TransactionInProgressException.h TransactionRolledBackException.cpp TransactionRolledBackException.h

Author: tabish
Date: Sun Nov 14 23:26:08 2010
New Revision: 1035100

URL: http://svn.apache.org/viewvc?rev=1035100&view=rev
Log:
Adds TransactionInProgressException and TransactionRolledBackException for use in the XA implementation.

Added:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionInProgressException.cpp   (with props)
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionInProgressException.h   (with props)
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionRolledBackException.cpp   (with props)
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionRolledBackException.h   (with props)

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionInProgressException.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionInProgressException.cpp?rev=1035100&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionInProgressException.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionInProgressException.cpp Sun Nov 14 23:26:08 2010
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "TransactionInProgressException.h"
+
+using namespace cms;
+
+////////////////////////////////////////////////////////////////////////////////
+TransactionInProgressException::TransactionInProgressException() : CMSException() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+TransactionInProgressException::TransactionInProgressException( const TransactionInProgressException& ex )
+    : CMSException( ex ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+TransactionInProgressException::TransactionInProgressException( const std::string& message )
+    : CMSException( message, NULL ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+TransactionInProgressException::TransactionInProgressException( const std::string& message, const std::exception* cause )
+    : CMSException( message, cause ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+TransactionInProgressException::TransactionInProgressException( const std::string& message,
+                                                                const std::exception* cause,
+                                                                const std::vector< std::pair< std::string, int> >& stackTrace )
+    : CMSException( message, cause, stackTrace ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+TransactionInProgressException::~TransactionInProgressException() throw() {
+}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionInProgressException.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionInProgressException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionInProgressException.h?rev=1035100&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionInProgressException.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionInProgressException.h Sun Nov 14 23:26:08 2010
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _CMS_TRANSACTIONINPROGRESSEXCEPTION_H_
+#define _CMS_TRANSACTIONINPROGRESSEXCEPTION_H_
+
+#include <cms/Config.h>
+#include <cms/CMSException.h>
+
+namespace cms {
+
+    /**
+     * This exception is thrown when an operation is invalid because a transaction is in progress.
+     * For instance, an attempt to call Session::commit when a session is part of a distributed
+     * transaction should throw a TransactionInProgressException.
+     *
+     * @since 2.3
+     */
+    class CMS_API TransactionInProgressException : public cms::CMSException {
+    public:
+
+        TransactionInProgressException();
+
+        TransactionInProgressException( const TransactionInProgressException& ex );
+
+        TransactionInProgressException( const std::string& message );
+
+        TransactionInProgressException( const std::string& message,
+                                        const std::exception* cause );
+
+        TransactionInProgressException( const std::string& message,
+                                        const std::exception* cause,
+                                        const std::vector< std::pair< std::string, int> >& stackTrace );
+
+        virtual ~TransactionInProgressException() throw();
+
+
+    };
+
+}
+
+#endif /* _CMS_TRANSACTIONINPROGRESSEXCEPTION_H_ */

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionInProgressException.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionRolledBackException.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionRolledBackException.cpp?rev=1035100&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionRolledBackException.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionRolledBackException.cpp Sun Nov 14 23:26:08 2010
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "TransactionRolledBackException.h"
+
+using namespace cms;
+
+////////////////////////////////////////////////////////////////////////////////
+TransactionRolledBackException::TransactionRolledBackException() : CMSException() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+TransactionRolledBackException::TransactionRolledBackException( const TransactionRolledBackException& ex )
+    : CMSException( ex ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+TransactionRolledBackException::TransactionRolledBackException( const std::string& message )
+    : CMSException( message, NULL ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+TransactionRolledBackException::TransactionRolledBackException( const std::string& message, const std::exception* cause )
+    : CMSException( message, cause ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+TransactionRolledBackException::TransactionRolledBackException( const std::string& message,
+                                                                const std::exception* cause,
+                                                                const std::vector< std::pair< std::string, int> >& stackTrace )
+    : CMSException( message, cause, stackTrace ) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+TransactionRolledBackException::~TransactionRolledBackException() throw() {
+}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionRolledBackException.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionRolledBackException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionRolledBackException.h?rev=1035100&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionRolledBackException.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionRolledBackException.h Sun Nov 14 23:26:08 2010
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _CMS_TRANSACTIONROLLEDBACKEXCEPTION_H_
+#define _CMS_TRANSACTIONROLLEDBACKEXCEPTION_H_
+
+#include <cms/Config.h>
+#include <cms/CMSException.h>
+
+namespace cms {
+
+    /**
+     * This exception must be thrown when a call to Session.commit results in a rollback of the
+     * current transaction.
+     *
+     * @since 2.3
+     */
+    class CMS_API TransactionRolledBackException : public cms::CMSException {
+    public:
+
+        TransactionRolledBackException();
+
+        TransactionRolledBackException( const TransactionRolledBackException& ex );
+
+        TransactionRolledBackException( const std::string& message );
+
+        TransactionRolledBackException( const std::string& message,
+                                        const std::exception* cause );
+
+        TransactionRolledBackException( const std::string& message,
+                                        const std::exception* cause,
+                                        const std::vector< std::pair< std::string, int> >& stackTrace );
+
+        virtual ~TransactionRolledBackException() throw();
+
+    };
+
+}
+
+#endif /* _CMS_TRANSACTIONROLLEDBACKEXCEPTION_H_ */

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/TransactionRolledBackException.h
------------------------------------------------------------------------------
    svn:eol-style = native