diff options
Diffstat (limited to 'dotnet/Qpid.Client/Client')
4 files changed, 40 insertions, 1 deletions
diff --git a/dotnet/Qpid.Client/Client/AMQConnectionException.cs b/dotnet/Qpid.Client/Client/AMQConnectionException.cs index 603a7b2a1c..a4caf02e2c 100644 --- a/dotnet/Qpid.Client/Client/AMQConnectionException.cs +++ b/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/dotnet/Qpid.Client/Client/Message/QpidBytesMessage.cs b/dotnet/Qpid.Client/Client/Message/QpidBytesMessage.cs index 8788856062..044dec58b1 100644 --- a/dotnet/Qpid.Client/Client/Message/QpidBytesMessage.cs +++ b/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/dotnet/Qpid.Client/Client/Message/UnexpectedBodyReceivedException.cs b/dotnet/Qpid.Client/Client/Message/UnexpectedBodyReceivedException.cs index 679114d105..a671f608d1 100644 --- a/dotnet/Qpid.Client/Client/Message/UnexpectedBodyReceivedException.cs +++ b/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/dotnet/Qpid.Client/Client/State/IllegalStateTransitionException.cs b/dotnet/Qpid.Client/Client/State/IllegalStateTransitionException.cs index 723ae04397..86b625951e 100644 --- a/dotnet/Qpid.Client/Client/State/IllegalStateTransitionException.cs +++ b/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); + } } } + |