diff options
author | Robert Greig <rgreig@apache.org> | 2007-01-05 10:26:09 +0000 |
---|---|---|
committer | Robert Greig <rgreig@apache.org> | 2007-01-05 10:26:09 +0000 |
commit | a7c424416087c556ac045786009473f0e6d93e40 (patch) | |
tree | 2b1666b113d543de0502fed1182d4e266cd04eb9 | |
parent | 4715a67339128b092cde470bc41ba054fa79fd3a (diff) | |
download | qpid-python-a7c424416087c556ac045786009473f0e6d93e40.tar.gz |
Patch for Qpid-246 applied. Makes exceptions serializable.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@492963 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | dotnet/Qpid.Buffer/BufferDataException.cs | 7 | ||||
-rw-r--r-- | dotnet/Qpid.Buffer/BufferOverflowException.cs | 8 | ||||
-rw-r--r-- | dotnet/Qpid.Buffer/BufferUnderflowException.cs | 8 | ||||
-rw-r--r-- | dotnet/Qpid.Client/Client/Failover/FailoverException.cs | 7 | ||||
-rw-r--r-- | dotnet/Qpid.Codec/ProtocolCodecException.cs | 8 | ||||
-rw-r--r-- | dotnet/Qpid.Common/AMQException.cs | 25 | ||||
-rw-r--r-- | dotnet/Qpid.Messaging/QpidException.cs | 7 |
7 files changed, 70 insertions, 0 deletions
diff --git a/dotnet/Qpid.Buffer/BufferDataException.cs b/dotnet/Qpid.Buffer/BufferDataException.cs index 1c6c37e84f..bce2d7ef5a 100644 --- a/dotnet/Qpid.Buffer/BufferDataException.cs +++ b/dotnet/Qpid.Buffer/BufferDataException.cs @@ -19,6 +19,7 @@ * */ using System; +using System.Runtime.Serialization; namespace Qpid.Buffer { @@ -26,6 +27,7 @@ namespace Qpid.Buffer * A {@link RuntimeException} which is thrown when the data the {@link ByteBuffer} * contains is corrupt. */ + [Serializable] public class BufferDataException : Exception { public BufferDataException() @@ -43,5 +45,10 @@ namespace Qpid.Buffer public BufferDataException( Exception cause ) : base("", cause) { } + + protected BufferDataException(SerializationInfo info, StreamingContext ctxt) + : base(info, ctxt) + { + } } } diff --git a/dotnet/Qpid.Buffer/BufferOverflowException.cs b/dotnet/Qpid.Buffer/BufferOverflowException.cs index b5896262da..2a7ad064d5 100644 --- a/dotnet/Qpid.Buffer/BufferOverflowException.cs +++ b/dotnet/Qpid.Buffer/BufferOverflowException.cs @@ -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) + { + } } } + diff --git a/dotnet/Qpid.Buffer/BufferUnderflowException.cs b/dotnet/Qpid.Buffer/BufferUnderflowException.cs index 9de6b6558f..c0cb850e63 100644 --- a/dotnet/Qpid.Buffer/BufferUnderflowException.cs +++ b/dotnet/Qpid.Buffer/BufferUnderflowException.cs @@ -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) + { + } } } + diff --git a/dotnet/Qpid.Client/Client/Failover/FailoverException.cs b/dotnet/Qpid.Client/Client/Failover/FailoverException.cs index b13b28a66b..e2bc5b8a71 100644 --- a/dotnet/Qpid.Client/Client/Failover/FailoverException.cs +++ b/dotnet/Qpid.Client/Client/Failover/FailoverException.cs @@ -19,6 +19,7 @@ * */ using System; +using System.Runtime.Serialization; namespace Qpid.Client.Failover { @@ -26,10 +27,16 @@ namespace Qpid.Client.Failover /// 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) + { + } } } diff --git a/dotnet/Qpid.Codec/ProtocolCodecException.cs b/dotnet/Qpid.Codec/ProtocolCodecException.cs index 797b475f19..a7d7bd9cb2 100644 --- a/dotnet/Qpid.Codec/ProtocolCodecException.cs +++ b/dotnet/Qpid.Codec/ProtocolCodecException.cs @@ -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 @@ namespace Qpid.Codec public ProtocolCodecException(Exception cause) : base("Codec Exception", cause) { } + + protected ProtocolCodecException(SerializationInfo info, StreamingContext ctxt) + : base(info, ctxt) + { + } } } + diff --git a/dotnet/Qpid.Common/AMQException.cs b/dotnet/Qpid.Common/AMQException.cs index 1b2f5a80bf..4c9c46946e 100644 --- a/dotnet/Qpid.Common/AMQException.cs +++ b/dotnet/Qpid.Common/AMQException.cs @@ -19,6 +19,7 @@ * */ using System; +using System.Runtime.Serialization; using log4net; namespace Qpid @@ -26,6 +27,7 @@ namespace Qpid /// <summary> /// The generic AMQ exception. /// </summary> + [Serializable] public class AMQException : Exception { private int _errorCode; @@ -105,6 +107,29 @@ namespace Qpid } /// <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. /// </summary> /// <value>The error code.</value> diff --git a/dotnet/Qpid.Messaging/QpidException.cs b/dotnet/Qpid.Messaging/QpidException.cs index 7f0c9873e5..dc3391898b 100644 --- a/dotnet/Qpid.Messaging/QpidException.cs +++ b/dotnet/Qpid.Messaging/QpidException.cs @@ -19,9 +19,11 @@ * */ using System; +using System.Runtime.Serialization; namespace Qpid.Messaging { + [Serializable] public class QpidException : Exception { public QpidException(string reason) : base(reason) @@ -32,5 +34,10 @@ namespace Qpid.Messaging : base(reason, e) { } + + protected QpidException(SerializationInfo info, StreamingContext ctxt) + : base(info, ctxt) + { + } } } |