Author: chug
Date: Wed Jan 15 19:41:38 2014
New Revision: 1558549

URL: http://svn.apache.org/r1558549
Log:
QPID-5481: Messaging API Update - r1460198 QPID-4586 Receiver and Sender 
'Address getAddress()' added

Modified:
    qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Receiver.cpp
    qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Receiver.h
    qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Sender.cpp
    qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Sender.h

Modified: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Receiver.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Receiver.cpp?rev=1558549&r1=1558548&r2=1558549&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Receiver.cpp (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Receiver.cpp Wed Jan 15 
19:41:38 2014
@@ -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;
+    }
 }}}}

Modified: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Receiver.h
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Receiver.h?rev=1558549&r1=1558548&r2=1558549&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Receiver.h (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Receiver.h Wed Jan 15 19:41:38 
2014
@@ -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();
     };
 }}}}

Modified: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Sender.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Sender.cpp?rev=1558549&r1=1558548&r2=1558549&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Sender.cpp (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Sender.cpp Wed Jan 15 19:41:38 
2014
@@ -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;
+    }
 }}}}

Modified: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Sender.h
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Sender.h?rev=1558549&r1=1558548&r2=1558549&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Sender.h (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Sender.h Wed Jan 15 19:41:38 
2014
@@ -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();
     };
 }}}}



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to