From 2b5c2503c20ff4ec367c805618f3a8f5cab1ce92 Mon Sep 17 00:00:00 2001 From: "Charles E. Rolke" Date: Thu, 16 Jan 2014 20:37:10 +0000 Subject: QPID-5481: Messaging API Update - 1520673 Connection reconnect() and getUrl() added git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1558911 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/bindings/qpid/dotnet/src/Connection.cpp | 50 ++++++++++++++++++++++++ qpid/cpp/bindings/qpid/dotnet/src/Connection.h | 14 +++++++ 2 files changed, 64 insertions(+) (limited to 'qpid/cpp') diff --git a/qpid/cpp/bindings/qpid/dotnet/src/Connection.cpp b/qpid/cpp/bindings/qpid/dotnet/src/Connection.cpp index 9171b5e9fc..d4d5d2fd4f 100644 --- a/qpid/cpp/bindings/qpid/dotnet/src/Connection.cpp +++ b/qpid/cpp/bindings/qpid/dotnet/src/Connection.cpp @@ -267,6 +267,56 @@ namespace Messaging { } } + + void Connection::Reconnect(System::String ^ url) + { + System::Exception ^ newException = nullptr; + + try + { + msclr::lock lk(privateLock); + ThrowIfDisposed(); + + std::string nativeUrl = QpidMarshal::ToNative(url); + nativeObjPtr->reconnect(nativeUrl); + } + catch (const ::qpid::types::Exception & error) + { + String ^ errmsg = gcnew String(error.what()); + newException = gcnew QpidException(errmsg); + } + + if (newException != nullptr) + { + throw newException; + } + } + + + void Connection::Reconnect() + { + System::Exception ^ newException = nullptr; + + try + { + msclr::lock lk(privateLock); + ThrowIfDisposed(); + + nativeObjPtr->reconnect(); + } + catch (const ::qpid::types::Exception & error) + { + String ^ errmsg = gcnew String(error.what()); + newException = gcnew QpidException(errmsg); + } + + if (newException != nullptr) + { + throw newException; + } + } + + // // CreateTransactionalSession() // diff --git a/qpid/cpp/bindings/qpid/dotnet/src/Connection.h b/qpid/cpp/bindings/qpid/dotnet/src/Connection.h index 27381d8d5e..82b5262084 100644 --- a/qpid/cpp/bindings/qpid/dotnet/src/Connection.h +++ b/qpid/cpp/bindings/qpid/dotnet/src/Connection.h @@ -129,6 +129,20 @@ namespace Messaging { } } + void Reconnect(System::String ^ url); + void Reconnect(); + + property System::String ^ Url + { + System::String ^ get() + { + msclr::lock lk(privateLock); + ThrowIfDisposed(); + + return gcnew System::String(nativeObjPtr->getUrl().c_str()); + } + } + // CreateTransactionalSession() Session ^ CreateTransactionalSession(); Session ^ CreateTransactionalSession(System::String ^ name); -- cgit v1.2.1