summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles E. Rolke <chug@apache.org>2014-01-16 20:37:10 +0000
committerCharles E. Rolke <chug@apache.org>2014-01-16 20:37:10 +0000
commit2b5c2503c20ff4ec367c805618f3a8f5cab1ce92 (patch)
treeaba26ffbf2346fc2c2327b66609c35eb9ffdb830
parent6991d18b7d5f776afc21b970caced01b2cb19034 (diff)
downloadqpid-python-2b5c2503c20ff4ec367c805618f3a8f5cab1ce92.tar.gz
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
-rw-r--r--qpid/cpp/bindings/qpid/dotnet/src/Connection.cpp50
-rw-r--r--qpid/cpp/bindings/qpid/dotnet/src/Connection.h14
2 files changed, 64 insertions, 0 deletions
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);