You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ch...@apache.org on 2010/11/02 15:29:51 UTC

svn commit: r1030061 - in /qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src: FailoverUpdates.cpp FailoverUpdates.h org.apache.qpid.messaging.vcproj

Author: chug
Date: Tue Nov  2 14:29:50 2010
New Revision: 1030061

URL: http://svn.apache.org/viewvc?rev=1030061&view=rev
Log:
QPID-2922 Qpid Cpp Messaging .NET Binding does not implement FailoverUpdate class

This checkin provides the implemtation.

Added:
    qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/FailoverUpdates.cpp
    qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/FailoverUpdates.h
Modified:
    qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/org.apache.qpid.messaging.vcproj

Added: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/FailoverUpdates.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/FailoverUpdates.cpp?rev=1030061&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/FailoverUpdates.cpp (added)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/FailoverUpdates.cpp Tue Nov  2 14:29:50 2010
@@ -0,0 +1,94 @@
+/*
+* 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 <windows.h>
+#include <msclr\lock.h>
+#include <oletx2xa.h>
+#include <string>
+#include <limits>
+
+#include "qpid/messaging/FailoverUpdates.h"
+
+#include "Connection.h"
+#include "FailoverUpdates.h"
+#include "QpidException.h"
+
+namespace Org {
+namespace Apache {
+namespace Qpid {
+namespace Messaging {
+
+    /// <summary>
+    /// FailoverUpdates is a managed wrapper for a qpid::messaging::FailoverUpdates
+    /// </summary>
+
+    // constructors
+    //FailoverUpdates::FailoverUpdates(Connection ^ connection) :
+    //    failoverupdatesp(new ::qpid::messaging::FailoverUpdates(*(connection->NativeConnection)))
+    //{
+    //}
+
+    FailoverUpdates::FailoverUpdates(Connection ^ connection)
+    {
+        System::Exception           ^ newException = nullptr;
+
+        try 
+		{
+            failoverupdatesp = new ::qpid::messaging::FailoverUpdates(*(connection->NativeConnection));
+        } 
+        catch (const ::qpid::types::Exception & error) 
+		{
+            String ^ errmsg = gcnew String(error.what());
+            newException    = gcnew QpidException(errmsg);
+        }
+
+		if (newException != nullptr) 
+		{
+	        throw newException;
+		}
+
+        return;
+    }
+
+
+    // Destructor
+    FailoverUpdates::~FailoverUpdates()
+    {
+        Cleanup();
+    }
+
+
+    // Finalizer
+    FailoverUpdates::!FailoverUpdates()
+    {
+        Cleanup();
+    }
+
+
+    // Destroys kept object
+    // TODO: add lock
+    void FailoverUpdates::Cleanup()
+    {
+        if (NULL != failoverupdatesp)
+        {
+            delete failoverupdatesp;
+            failoverupdatesp = NULL;
+        }
+    }
+}}}}

Added: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/FailoverUpdates.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/FailoverUpdates.h?rev=1030061&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/FailoverUpdates.h (added)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/FailoverUpdates.h Tue Nov  2 14:29:50 2010
@@ -0,0 +1,67 @@
+/*
+* 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.
+*/
+
+#pragma once
+
+#include <windows.h>
+#include <msclr\lock.h>
+#include <oletx2xa.h>
+#include <string>
+#include <limits>
+
+namespace Org {
+namespace Apache {
+namespace Qpid {
+namespace Messaging {
+
+    /// <summary>
+    /// FailoverUpdates is a managed wrapper for a qpid::messaging::FailoverUpdates
+    /// </summary>
+
+    ref class Connection;
+
+    public ref class FailoverUpdates
+    {
+    private:
+        // The kept object in the Messaging C++ DLL
+        ::qpid::messaging::FailoverUpdates * failoverupdatesp;
+
+        // Kept object deletion code
+        void Cleanup();
+
+    public:
+        FailoverUpdates(Connection ^ connection);
+
+        ~FailoverUpdates();
+        !FailoverUpdates();
+
+    private:
+		// unmanaged clone
+		// not defined
+
+        // copy constructor
+        FailoverUpdates(const FailoverUpdates ^ failoverUpdates) {}
+
+        // assignment operator
+        FailoverUpdates % operator=(const FailoverUpdates % rhs) 
+        {
+            return *this;
+        }
+    };
+}}}}

Modified: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/org.apache.qpid.messaging.vcproj
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/org.apache.qpid.messaging.vcproj?rev=1030061&r1=1030060&r2=1030061&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/org.apache.qpid.messaging.vcproj (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/org.apache.qpid.messaging.vcproj Tue Nov  2 14:29:50 2010
@@ -538,6 +538,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\FailoverUpdates.cpp"
+				>
+			</File>
+			<File
 				RelativePath=".\Message.cpp"
 				>
 			</File>
@@ -576,6 +580,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\FailoverUpdates.h"
+				>
+			</File>
+			<File
 				RelativePath=".\Message.h"
 				>
 			</File>



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org