summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles E. Rolke <chug@apache.org>2014-01-15 19:41:38 +0000
committerCharles E. Rolke <chug@apache.org>2014-01-15 19:41:38 +0000
commita6e5e1fa9e750c8667cabfb752f0d5174eba70a5 (patch)
treede443c677864ee752a3125e31f6916fc45a28ff9
parent4b6e899e06106dd310810c7813d689cd2a23c42b (diff)
downloadqpid-python-a6e5e1fa9e750c8667cabfb752f0d5174eba70a5.tar.gz
QPID-5481: Messaging API Update - r1460198 QPID-4586 Receiver and Sender 'Address getAddress()' added
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1558549 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/bindings/qpid/dotnet/src/Receiver.cpp41
-rw-r--r--qpid/cpp/bindings/qpid/dotnet/src/Receiver.h7
-rw-r--r--qpid/cpp/bindings/qpid/dotnet/src/Sender.cpp42
-rw-r--r--qpid/cpp/bindings/qpid/dotnet/src/Sender.h7
4 files changed, 97 insertions, 0 deletions
diff --git a/qpid/cpp/bindings/qpid/dotnet/src/Receiver.cpp b/qpid/cpp/bindings/qpid/dotnet/src/Receiver.cpp
index 5dbc83dcbf..2d6b2f56c3 100644
--- a/qpid/cpp/bindings/qpid/dotnet/src/Receiver.cpp
+++ b/qpid/cpp/bindings/qpid/dotnet/src/Receiver.cpp
@@ -29,6 +29,7 @@
#include "qpid/messaging/exceptions.h"
#include "Receiver.h"
+#include "Address.h"
#include "Session.h"
#include "Message.h"
#include "Duration.h"
@@ -374,4 +375,44 @@ namespace Messaging {
throw newException;
}
}
+
+ Org::Apache::Qpid::Messaging::Address ^ Receiver::GetAddress()
+ {
+ msclr::lock lk(privateLock);
+ ThrowIfDisposed();
+
+ System::Exception ^ newException = nullptr;
+ Messaging::Address ^ newAddress = nullptr;
+
+ try
+ {
+ // fetch unmanaged Address
+ ::qpid::messaging::Address addr =
+ nativeObjPtr->getAddress();
+
+ // create a managed Address
+ newAddress = gcnew Address(addr);
+ }
+ catch (const ::qpid::types::Exception & error)
+ {
+ String ^ errmsg = gcnew String(error.what());
+ newException = gcnew QpidException(errmsg);
+ }
+ finally
+ {
+ if (newException != nullptr)
+ {
+ if (newAddress != nullptr)
+ {
+ delete newAddress;
+ }
+ }
+ }
+ if (newException != nullptr)
+ {
+ throw newException;
+ }
+
+ return newAddress;
+ }
}}}}
diff --git a/qpid/cpp/bindings/qpid/dotnet/src/Receiver.h b/qpid/cpp/bindings/qpid/dotnet/src/Receiver.h
index 77b361851e..c38590c1b0 100644
--- a/qpid/cpp/bindings/qpid/dotnet/src/Receiver.h
+++ b/qpid/cpp/bindings/qpid/dotnet/src/Receiver.h
@@ -25,6 +25,7 @@
#include <limits>
#include "qpid/messaging/Receiver.h"
+#include "qpid/messaging/Address.h"
#include "qpid/messaging/Session.h"
#include "qpid/messaging/Message.h"
#include "qpid/messaging/Duration.h"
@@ -44,6 +45,7 @@ namespace Messaging {
/// Receiver is a managed wrapper for a ::qpid::messaging::Receiver
/// </summary>
+ ref class Address;
ref class Session;
ref class Message;
ref class Duration;
@@ -232,5 +234,10 @@ namespace Messaging {
return parentSession;
}
}
+
+ //
+ // Address
+ //
+ Org::Apache::Qpid::Messaging::Address ^ GetAddress();
};
}}}}
diff --git a/qpid/cpp/bindings/qpid/dotnet/src/Sender.cpp b/qpid/cpp/bindings/qpid/dotnet/src/Sender.cpp
index 8600d0fd8c..3d863eb7c7 100644
--- a/qpid/cpp/bindings/qpid/dotnet/src/Sender.cpp
+++ b/qpid/cpp/bindings/qpid/dotnet/src/Sender.cpp
@@ -23,11 +23,13 @@
#include <string>
#include <limits>
+#include "qpid/messaging/Address.h"
#include "qpid/messaging/Sender.h"
#include "qpid/messaging/Session.h"
#include "qpid/messaging/Message.h"
#include "Sender.h"
+#include "Address.h"
#include "Message.h"
#include "QpidException.h"
@@ -199,4 +201,44 @@ namespace Messaging {
throw newException;
}
}
+
+ Org::Apache::Qpid::Messaging::Address ^ Sender::GetAddress()
+ {
+ msclr::lock lk(privateLock);
+ ThrowIfDisposed();
+
+ System::Exception ^ newException = nullptr;
+ Messaging::Address ^ newAddress = nullptr;
+
+ try
+ {
+ // fetch unmanaged Address
+ ::qpid::messaging::Address addr =
+ nativeObjPtr->getAddress();
+
+ // create a managed Address
+ newAddress = gcnew Address(addr);
+ }
+ catch (const ::qpid::types::Exception & error)
+ {
+ String ^ errmsg = gcnew String(error.what());
+ newException = gcnew QpidException(errmsg);
+ }
+ finally
+ {
+ if (newException != nullptr)
+ {
+ if (newAddress != nullptr)
+ {
+ delete newAddress;
+ }
+ }
+ }
+ if (newException != nullptr)
+ {
+ throw newException;
+ }
+
+ return newAddress;
+ }
}}}}
diff --git a/qpid/cpp/bindings/qpid/dotnet/src/Sender.h b/qpid/cpp/bindings/qpid/dotnet/src/Sender.h
index 0d477b795f..3ecc615608 100644
--- a/qpid/cpp/bindings/qpid/dotnet/src/Sender.h
+++ b/qpid/cpp/bindings/qpid/dotnet/src/Sender.h
@@ -25,6 +25,7 @@
#include <limits>
#include "qpid/messaging/Sender.h"
+#include "qpid/messaging/Address.h"
#include "qpid/messaging/Session.h"
#include "qpid/messaging/Message.h"
@@ -43,6 +44,7 @@ namespace Messaging {
/// Sender is a managed wrapper for a ::qpid::messaging::Sender
/// </summary>
+ ref class Address;
ref class Session;
ref class Message;
@@ -188,5 +190,10 @@ namespace Messaging {
return parentSession;
}
}
+
+ //
+ // Address
+ //
+ Org::Apache::Qpid::Messaging::Address ^ GetAddress();
};
}}}}