summaryrefslogtreecommitdiff
path: root/cpp
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
commit910556efefca56752ac0ba692d0a2ecc6847158d (patch)
tree33c5c3af00d393f1160b23cf115182140a476cd0 /cpp
parentfd5d04f76a92bdf712cda2d5d9b6a46eced97a11 (diff)
downloadqpid-python-910556efefca56752ac0ba692d0a2ecc6847158d.tar.gz
QPID-5481: Messaging API Update - 1520673 Connection reconnect() and getUrl() added
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1558911 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/bindings/qpid/dotnet/src/Connection.cpp50
-rw-r--r--cpp/bindings/qpid/dotnet/src/Connection.h14
2 files changed, 64 insertions, 0 deletions
diff --git a/cpp/bindings/qpid/dotnet/src/Connection.cpp b/cpp/bindings/qpid/dotnet/src/Connection.cpp
index 9171b5e9fc..d4d5d2fd4f 100644
--- a/cpp/bindings/qpid/dotnet/src/Connection.cpp
+++ b/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/cpp/bindings/qpid/dotnet/src/Connection.h b/cpp/bindings/qpid/dotnet/src/Connection.h
index 27381d8d5e..82b5262084 100644
--- a/cpp/bindings/qpid/dotnet/src/Connection.h
+++ b/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);