Author: rgreig
Date: Fri Jan  5 02:26:09 2007
New Revision: 492963

URL: http://svn.apache.org/viewvc?view=rev&rev=492963
Log:
Patch for Qpid-246 applied. Makes exceptions serializable.

Modified:
    incubator/qpid/trunk/qpid/dotnet/Qpid.Buffer/BufferDataException.cs
    incubator/qpid/trunk/qpid/dotnet/Qpid.Buffer/BufferOverflowException.cs
    incubator/qpid/trunk/qpid/dotnet/Qpid.Buffer/BufferUnderflowException.cs
    
incubator/qpid/trunk/qpid/dotnet/Qpid.Client/Client/Failover/FailoverException.cs
    incubator/qpid/trunk/qpid/dotnet/Qpid.Codec/ProtocolCodecException.cs
    incubator/qpid/trunk/qpid/dotnet/Qpid.Common/AMQException.cs
    incubator/qpid/trunk/qpid/dotnet/Qpid.Messaging/QpidException.cs

Modified: incubator/qpid/trunk/qpid/dotnet/Qpid.Buffer/BufferDataException.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/Qpid.Buffer/BufferDataException.cs?view=diff&rev=492963&r1=492962&r2=492963
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/Qpid.Buffer/BufferDataException.cs 
(original)
+++ incubator/qpid/trunk/qpid/dotnet/Qpid.Buffer/BufferDataException.cs Fri Jan 
 5 02:26:09 2007
@@ -19,6 +19,7 @@
  *
  */
 using System;
+using System.Runtime.Serialization;
 
 namespace Qpid.Buffer
 {
@@ -26,6 +27,7 @@
      * A [EMAIL PROTECTED] RuntimeException} which is thrown when the data the 
[EMAIL PROTECTED] ByteBuffer}
      * contains is corrupt.
      */
+    [Serializable]
     public class BufferDataException : Exception
     {
         public BufferDataException()
@@ -41,6 +43,11 @@
         }
 
         public BufferDataException( Exception cause ) : base("", cause)
+        {
+        }
+
+        protected BufferDataException(SerializationInfo info, StreamingContext 
ctxt)
+           : base(info, ctxt)
         {
         }
     }    

Modified: 
incubator/qpid/trunk/qpid/dotnet/Qpid.Buffer/BufferOverflowException.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/Qpid.Buffer/BufferOverflowException.cs?view=diff&rev=492963&r1=492962&r2=492963
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/Qpid.Buffer/BufferOverflowException.cs 
(original)
+++ incubator/qpid/trunk/qpid/dotnet/Qpid.Buffer/BufferOverflowException.cs Fri 
Jan  5 02:26:09 2007
@@ -19,14 +19,22 @@
  *
  */
 using System;
+using System.Runtime.Serialization;
 
 namespace Qpid.Buffer
 {
+    [Serializable]
     public class BufferOverflowException : Exception
     {
         public BufferOverflowException(string message) : base(message)
         {
         }
+
+         protected BufferOverflowException(SerializationInfo info, 
StreamingContext ctxt)
+           : base(info, ctxt)
+        {
+        }
     }
 }
+
 

Modified: 
incubator/qpid/trunk/qpid/dotnet/Qpid.Buffer/BufferUnderflowException.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/Qpid.Buffer/BufferUnderflowException.cs?view=diff&rev=492963&r1=492962&r2=492963
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/Qpid.Buffer/BufferUnderflowException.cs 
(original)
+++ incubator/qpid/trunk/qpid/dotnet/Qpid.Buffer/BufferUnderflowException.cs 
Fri Jan  5 02:26:09 2007
@@ -19,15 +19,23 @@
  *
  */
 using System;
+using System.Runtime.Serialization;
 
 namespace Qpid.Buffer
 {
+    [Serializable]
     public class BufferUnderflowException : Exception
     {
         public BufferUnderflowException(string message)
             : base(message)
         {
         }
+
+        protected BufferUnderflowException(SerializationInfo info, 
StreamingContext ctxt)
+           : base(info, ctxt)
+        {
+        }
     }
 }
+
 

Modified: 
incubator/qpid/trunk/qpid/dotnet/Qpid.Client/Client/Failover/FailoverException.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/Qpid.Client/Client/Failover/FailoverException.cs?view=diff&rev=492963&r1=492962&r2=492963
==============================================================================
--- 
incubator/qpid/trunk/qpid/dotnet/Qpid.Client/Client/Failover/FailoverException.cs
 (original)
+++ 
incubator/qpid/trunk/qpid/dotnet/Qpid.Client/Client/Failover/FailoverException.cs
 Fri Jan  5 02:26:09 2007
@@ -19,6 +19,7 @@
  *
  */
 using System;
+using System.Runtime.Serialization;
 
 namespace Qpid.Client.Failover
 {
@@ -26,9 +27,15 @@
     /// This exception is thrown when failover is taking place and we need to 
let other
     /// parts of the client know about this.
     /// </summary>
+    [Serializable]
     class FailoverException : Exception
     {
         public FailoverException(String message) : base(message)
+        {
+        }
+
+        protected FailoverException(SerializationInfo info, StreamingContext 
ctxt)
+           : base(info, ctxt)
         {
         }
     }

Modified: incubator/qpid/trunk/qpid/dotnet/Qpid.Codec/ProtocolCodecException.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/Qpid.Codec/ProtocolCodecException.cs?view=diff&rev=492963&r1=492962&r2=492963
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/Qpid.Codec/ProtocolCodecException.cs 
(original)
+++ incubator/qpid/trunk/qpid/dotnet/Qpid.Codec/ProtocolCodecException.cs Fri 
Jan  5 02:26:09 2007
@@ -19,9 +19,11 @@
  *
  */
 using System;
+using System.Runtime.Serialization;
 
 namespace Qpid.Codec
 {
+    [Serializable]
     public class ProtocolCodecException : Exception
     {
         public ProtocolCodecException() : base()
@@ -35,6 +37,12 @@
         public ProtocolCodecException(Exception cause) : base("Codec 
Exception", cause)
         {            
         }
+
+        protected ProtocolCodecException(SerializationInfo info, 
StreamingContext ctxt)
+           : base(info, ctxt)
+        {
+        }
     }
 }
+
 

Modified: incubator/qpid/trunk/qpid/dotnet/Qpid.Common/AMQException.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/Qpid.Common/AMQException.cs?view=diff&rev=492963&r1=492962&r2=492963
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/Qpid.Common/AMQException.cs (original)
+++ incubator/qpid/trunk/qpid/dotnet/Qpid.Common/AMQException.cs Fri Jan  5 
02:26:09 2007
@@ -19,6 +19,7 @@
  *
  */
 using System;
+using System.Runtime.Serialization;
 using log4net;
 
 namespace Qpid
@@ -26,6 +27,7 @@
     /// <summary>
     /// The generic AMQ exception.
     /// </summary>
+    [Serializable]
     public class AMQException : Exception
     {
         private int _errorCode;
@@ -103,6 +105,29 @@
         {
             logger.Error(message, innerException);
         }
+
+        /// <summary>
+        /// Serialization Constructor
+        /// </summary>
+        /// <param name="info">SerializationInfo object</param>
+        /// <param name="ctxt">StreamingContext object</param>
+        protected AMQException(SerializationInfo info, StreamingContext ctxt)
+           : base(info, ctxt)
+        {
+           _errorCode = info.GetInt32("ErrorCode");
+        }
+
+        /// <summary>
+        /// ISerializable implementation of GetObjectData()
+        /// </summary>
+        /// <param name="info">SerializationInfo object</param>
+        /// <param name="ctxt">StreamingContext object</param>
+        public override void GetObjectData(SerializationInfo info, 
StreamingContext context)
+        {
+            base.GetObjectData(info, context);
+            info.AddValue("ErrorCode", _errorCode);
+        }
+
 
         /// <summary>
         /// Gets or sets the error code. See RFC 006 for details of error 
codes.

Modified: incubator/qpid/trunk/qpid/dotnet/Qpid.Messaging/QpidException.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/Qpid.Messaging/QpidException.cs?view=diff&rev=492963&r1=492962&r2=492963
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/Qpid.Messaging/QpidException.cs (original)
+++ incubator/qpid/trunk/qpid/dotnet/Qpid.Messaging/QpidException.cs Fri Jan  5 
02:26:09 2007
@@ -19,9 +19,11 @@
  *
  */
 using System;
+using System.Runtime.Serialization;
 
 namespace Qpid.Messaging
 {   
+    [Serializable]
     public class QpidException : Exception
     {
         public QpidException(string reason) : base(reason)
@@ -30,6 +32,11 @@
 
         public QpidException(string reason, Exception e)
             : base(reason, e)
+        {
+        }
+
+        protected QpidException(SerializationInfo info, StreamingContext ctxt)
+           : base(info, ctxt)
         {
         }
     }


Reply via email to