summaryrefslogtreecommitdiff
path: root/qpid/dotnet/Qpid.Client
diff options
context:
space:
mode:
authorRobert Greig <rgreig@apache.org>2007-01-05 17:00:41 +0000
committerRobert Greig <rgreig@apache.org>2007-01-05 17:00:41 +0000
commitbf9d3b6d38bd1232776626a6624620cae4911f10 (patch)
treecd4d7f4475c03345d80ad354b84986a70cea1c4d /qpid/dotnet/Qpid.Client
parent77ee523f3adec34bd9194b9697d9f933b7f4d4a7 (diff)
downloadqpid-python-bf9d3b6d38bd1232776626a6624620cae4911f10.tar.gz
Qpid-246-2 patch applied. Adds serializability to exceptions missed by the first patch.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@493087 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/dotnet/Qpid.Client')
-rw-r--r--qpid/dotnet/Qpid.Client/Client/AMQConnectionException.cs9
-rw-r--r--qpid/dotnet/Qpid.Client/Client/Message/QpidBytesMessage.cs7
-rw-r--r--qpid/dotnet/Qpid.Client/Client/Message/UnexpectedBodyReceivedException.cs8
-rw-r--r--qpid/dotnet/Qpid.Client/Client/State/IllegalStateTransitionException.cs17
-rw-r--r--qpid/dotnet/Qpid.Client/qms/UrlSyntaxException.cs18
5 files changed, 58 insertions, 1 deletions
diff --git a/qpid/dotnet/Qpid.Client/Client/AMQConnectionException.cs b/qpid/dotnet/Qpid.Client/Client/AMQConnectionException.cs
index 603a7b2a1c..a4caf02e2c 100644
--- a/qpid/dotnet/Qpid.Client/Client/AMQConnectionException.cs
+++ b/qpid/dotnet/Qpid.Client/Client/AMQConnectionException.cs
@@ -19,13 +19,20 @@
*
*/
using System;
+using System.Runtime.Serialization;
namespace Qpid.Client
{
+ [Serializable]
public class AMQConnectionException : AMQException
{
public AMQConnectionException(String message, Exception e) : base(message, e)
{
}
+
+ protected AMQConnectionException(SerializationInfo info, StreamingContext ctxt)
+ : base(info, ctxt)
+ {
+ }
}
-} \ No newline at end of file
+}
diff --git a/qpid/dotnet/Qpid.Client/Client/Message/QpidBytesMessage.cs b/qpid/dotnet/Qpid.Client/Client/Message/QpidBytesMessage.cs
index 8788856062..044dec58b1 100644
--- a/qpid/dotnet/Qpid.Client/Client/Message/QpidBytesMessage.cs
+++ b/qpid/dotnet/Qpid.Client/Client/Message/QpidBytesMessage.cs
@@ -20,6 +20,7 @@
*/
using System;
using System.IO;
+using System.Runtime.Serialization;
using System.Text;
using Qpid.Framing;
using Qpid.Messaging;
@@ -27,11 +28,17 @@ using Qpid.Buffer;
namespace Qpid.Client.Message
{
+ [Serializable]
class MessageEOFException : QpidException
{
public MessageEOFException(string message) : base(message)
{
}
+
+ protected MessageEOFException(SerializationInfo info, StreamingContext ctxt)
+ : base(info, ctxt)
+ {
+ }
}
public class QpidBytesMessage : AbstractQmsMessage, IBytesMessage
diff --git a/qpid/dotnet/Qpid.Client/Client/Message/UnexpectedBodyReceivedException.cs b/qpid/dotnet/Qpid.Client/Client/Message/UnexpectedBodyReceivedException.cs
index 679114d105..a671f608d1 100644
--- a/qpid/dotnet/Qpid.Client/Client/Message/UnexpectedBodyReceivedException.cs
+++ b/qpid/dotnet/Qpid.Client/Client/Message/UnexpectedBodyReceivedException.cs
@@ -19,6 +19,7 @@
*
*/
using System;
+using System.Runtime.Serialization;
using log4net;
namespace Qpid.Client.Message
@@ -27,6 +28,7 @@ namespace Qpid.Client.Message
/// Raised when a message body is received unexpectedly by the client. This typically occurs when the
/// length of bodies received does not match with the declared length in the content header.
/// </summary>
+ [Serializable]
public class UnexpectedBodyReceivedException : AMQException
{
public UnexpectedBodyReceivedException(ILog logger, string msg, Exception t)
@@ -43,6 +45,12 @@ namespace Qpid.Client.Message
: base(logger, errorCode, msg)
{
}
+
+ protected UnexpectedBodyReceivedException(SerializationInfo info, StreamingContext ctxt)
+ : base(info, ctxt)
+ {
+ }
}
}
+
diff --git a/qpid/dotnet/Qpid.Client/Client/State/IllegalStateTransitionException.cs b/qpid/dotnet/Qpid.Client/Client/State/IllegalStateTransitionException.cs
index 723ae04397..86b625951e 100644
--- a/qpid/dotnet/Qpid.Client/Client/State/IllegalStateTransitionException.cs
+++ b/qpid/dotnet/Qpid.Client/Client/State/IllegalStateTransitionException.cs
@@ -19,9 +19,11 @@
*
*/
using System;
+using System.Runtime.Serialization;
namespace Qpid.Client.State
{
+ [Serializable]
public class IllegalStateTransitionException : AMQException
{
private AMQState _originalState;
@@ -36,6 +38,13 @@ namespace Qpid.Client.State
_frame = frame;
}
+ protected IllegalStateTransitionException(SerializationInfo info, StreamingContext ctxt)
+ : base(info, ctxt)
+ {
+ _originalState = (AMQState)info.GetValue("OriginalState", typeof(AMQState));
+ _frame = (Type)info.GetValue("FrameType", typeof(Type));
+ }
+
public AMQState OriginalState
{
get
@@ -51,6 +60,14 @@ namespace Qpid.Client.State
return _frame;
}
}
+
+ public override void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ base.GetObjectData(info, context);
+ info.AddValue("OriginalState", OriginalState);
+ info.AddValue("FrameType", FrameType);
+ }
}
}
+
diff --git a/qpid/dotnet/Qpid.Client/qms/UrlSyntaxException.cs b/qpid/dotnet/Qpid.Client/qms/UrlSyntaxException.cs
index f7aaf56085..e6da62a829 100644
--- a/qpid/dotnet/Qpid.Client/qms/UrlSyntaxException.cs
+++ b/qpid/dotnet/Qpid.Client/qms/UrlSyntaxException.cs
@@ -19,10 +19,12 @@
*
*/
using System;
+using System.Runtime.Serialization;
using System.Text;
namespace Qpid.Client.qms
{
+ [Serializable]
public class UrlSyntaxException : UriFormatException
{
private string _url;
@@ -53,6 +55,22 @@ namespace Qpid.Client.qms
_length = length;
}
+ protected UrlSyntaxException(SerializationInfo info, StreamingContext ctxt)
+ : base(info, ctxt)
+ {
+ _url = info.GetString("Url");
+ _index = info.GetInt32("Index");
+ _length = info.GetInt32("Length");
+ }
+
+ public override void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ base.GetObjectData(info, context);
+ info.AddValue("Url", _url);
+ info.AddValue("Index", _index);
+ info.AddValue("Length", _length);
+ }
+
private static String getPositionString(int index, int length)
{
StringBuilder sb = new StringBuilder(index + 1);