Skip to content
Permalink
Browse files
Refactor serialization support of NMS exceptions for .NET Compact Fra…
…mework.

Fixes [AMQNET-210]. (See https://issues.apache.org/activemq/browse/AMQNET-210)
  • Loading branch information
Jim Gomes committed Feb 9, 2010
1 parent fd8a211 commit 887ca44e72c8f9ae3aab37d8eae421ed18c811c2
Show file tree
Hide file tree
Showing 14 changed files with 47 additions and 35 deletions.
@@ -18,7 +18,6 @@
*/

using System;
using System.Runtime.Serialization;

namespace Apache.NMS
{
@@ -51,6 +50,7 @@ public IllegalStateException(string message, string errorCode, Exception innerEx
}

#region ISerializable interface implementation
#if !NETCF

/// <summary>
/// Initializes a new instance of the IllegalStateException class with serialized data.
@@ -59,11 +59,12 @@ public IllegalStateException(string message, string errorCode, Exception innerEx
/// </summary>
/// <param name="info">The SerializationInfo that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
protected IllegalStateException(SerializationInfo info, StreamingContext context)
protected IllegalStateException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context)
{
}

#endif
#endregion
}
}
@@ -18,7 +18,6 @@
*/

using System;
using System.Runtime.Serialization;

namespace Apache.NMS
{
@@ -51,6 +50,7 @@ public InvalidClientIDException(string message, string errorCode, Exception inne
}

#region ISerializable interface implementation
#if !NETCF

/// <summary>
/// Initializes a new instance of the InvalidClientIDException class with serialized data.
@@ -59,11 +59,12 @@ public InvalidClientIDException(string message, string errorCode, Exception inne
/// </summary>
/// <param name="info">The SerializationInfo that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
protected InvalidClientIDException(SerializationInfo info, StreamingContext context)
protected InvalidClientIDException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context)
{
}

#endif
#endregion
}
}
@@ -14,8 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

using System;
using System.Runtime.Serialization;

namespace Apache.NMS
{
@@ -51,6 +51,7 @@ public InvalidDestinationException(string message, string errorCode, Exception i
}

#region ISerializable interface implementation
#if !NETCF

/// <summary>
/// Initializes a new instance of the InvalidDestinationException class with serialized data.
@@ -59,11 +60,12 @@ public InvalidDestinationException(string message, string errorCode, Exception i
/// </summary>
/// <param name="info">The SerializationInfo that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
protected InvalidDestinationException(SerializationInfo info, StreamingContext context)
protected InvalidDestinationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context)
{
}

#endif
#endregion
}
}
@@ -18,7 +18,6 @@
*/

using System;
using System.Runtime.Serialization;

namespace Apache.NMS
{
@@ -51,6 +50,7 @@ public InvalidSelectorException(string message, string errorCode, Exception inne
}

#region ISerializable interface implementation
#if !NETCF

/// <summary>
/// Initializes a new instance of the InvalidSelectorException class with serialized data.
@@ -59,11 +59,12 @@ public InvalidSelectorException(string message, string errorCode, Exception inne
/// </summary>
/// <param name="info">The SerializationInfo that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
protected InvalidSelectorException(SerializationInfo info, StreamingContext context)
protected InvalidSelectorException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context)
{
}

#endif
#endregion
}
}
@@ -18,7 +18,6 @@
*/

using System;
using System.Runtime.Serialization;

namespace Apache.NMS
{
@@ -51,6 +50,7 @@ public MessageEOFException(string message, string errorCode, Exception innerExce
}

#region ISerializable interface implementation
#if !NETCF

/// <summary>
/// Initializes a new instance of the MessageEOFException class with serialized data.
@@ -59,11 +59,12 @@ public MessageEOFException(string message, string errorCode, Exception innerExce
/// </summary>
/// <param name="info">The SerializationInfo that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
protected MessageEOFException(SerializationInfo info, StreamingContext context)
protected MessageEOFException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context)
{
}

#endif
#endregion
}
}
@@ -18,7 +18,6 @@
*/

using System;
using System.Runtime.Serialization;

namespace Apache.NMS
{
@@ -51,6 +50,7 @@ public MessageFormatException(string message, string errorCode, Exception innerE
}

#region ISerializable interface implementation
#if !NETCF

/// <summary>
/// Initializes a new instance of the MessageFormatException class with serialized data.
@@ -59,11 +59,12 @@ public MessageFormatException(string message, string errorCode, Exception innerE
/// </summary>
/// <param name="info">The SerializationInfo that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
protected MessageFormatException(SerializationInfo info, StreamingContext context)
protected MessageFormatException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context)
{
}

#endif
#endregion
}
}
@@ -18,7 +18,6 @@
*/

using System;
using System.Runtime.Serialization;

namespace Apache.NMS
{
@@ -51,6 +50,7 @@ public MessageNotReadableException(string message, string errorCode, Exception i
}

#region ISerializable interface implementation
#if !NETCF

/// <summary>
/// Initializes a new instance of the MessageNotReadableException class with serialized data.
@@ -59,11 +59,12 @@ public MessageNotReadableException(string message, string errorCode, Exception i
/// </summary>
/// <param name="info">The SerializationInfo that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
protected MessageNotReadableException(SerializationInfo info, StreamingContext context)
protected MessageNotReadableException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context)
{
}

#endif
#endregion
}
}
@@ -18,7 +18,6 @@
*/

using System;
using System.Runtime.Serialization;

namespace Apache.NMS
{
@@ -51,6 +50,7 @@ public MessageNotWriteableException(string message, string errorCode, Exception
}

#region ISerializable interface implementation
#if !NETCF

/// <summary>
/// Initializes a new instance of the MessageNotWriteableException class with serialized data.
@@ -59,11 +59,12 @@ public MessageNotWriteableException(string message, string errorCode, Exception
/// </summary>
/// <param name="info">The SerializationInfo that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
protected MessageNotWriteableException(SerializationInfo info, StreamingContext context)
protected MessageNotWriteableException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context)
{
}

#endif
#endregion
}
}
@@ -16,7 +16,6 @@
*/

using System;
using System.Runtime.Serialization;

namespace Apache.NMS
{
@@ -52,6 +51,7 @@ public NMSConnectionException(string message, string errorCode, Exception innerE
}

#region ISerializable interface implementation
#if !NETCF

/// <summary>
/// Initializes a new instance of the NMSConnectionException class with serialized data.
@@ -60,11 +60,12 @@ public NMSConnectionException(string message, string errorCode, Exception innerE
/// </summary>
/// <param name="info">The SerializationInfo that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
protected NMSConnectionException(SerializationInfo info, StreamingContext context)
protected NMSConnectionException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context)
{
}

#endif
#endregion
}
}
@@ -16,7 +16,6 @@
*/

using System;
using System.Runtime.Serialization;

namespace Apache.NMS
{
@@ -56,6 +55,7 @@ public NMSException(string message, string errorCode, Exception innerException)
}

#region ISerializable interface implementation
#if !NETCF

/// <summary>
/// Initializes a new instance of the NMSException class with serialized data.
@@ -64,26 +64,24 @@ public NMSException(string message, string errorCode, Exception innerException)
/// </summary>
/// <param name="info">The SerializationInfo that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
protected NMSException(SerializationInfo info, StreamingContext context)
protected NMSException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context)
{
exceptionErrorCode = info.GetString("NMSException.exceptionErrorCode");
}

/// <summary>
/// When overridden in a derived class, sets the SerializationInfo
/// with information about the exception.
/// When overridden in a derived class, sets the SerializationInfo with information about the exception.
/// </summary>
/// <param name="info">The System.Runtime.Serialization.SerializationInfo that holds the serialized
/// object data about the exception being thrown.</param>
/// <param name="context">The StreamingContext that contains contextual information about the source
/// or destination.</param>
public override void GetObjectData(SerializationInfo info, StreamingContext context)
/// <param name="info">The SerializationInfo that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
{
base.GetObjectData(info, context);
info.AddValue("NMSException.exceptionErrorCode", exceptionErrorCode);
}

#endif
#endregion

/// <summary>
@@ -16,7 +16,6 @@
*/

using System;
using System.Runtime.Serialization;

namespace Apache.NMS
{
@@ -52,6 +51,7 @@ public NMSSecurityException(string message, string errorCode, Exception innerExc
}

#region ISerializable interface implementation
#if !NETCF

/// <summary>
/// Initializes a new instance of the NMSSecurityException class with serialized data.
@@ -60,11 +60,12 @@ public NMSSecurityException(string message, string errorCode, Exception innerExc
/// </summary>
/// <param name="info">The SerializationInfo that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
protected NMSSecurityException(SerializationInfo info, StreamingContext context)
protected NMSSecurityException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context)
{
}

#endif
#endregion
}
}
@@ -18,7 +18,6 @@
*/

using System;
using System.Runtime.Serialization;

namespace Apache.NMS
{
@@ -51,6 +50,7 @@ public ResourceAllocationException(string message, string errorCode, Exception i
}

#region ISerializable interface implementation
#if !NETCF

/// <summary>
/// Initializes a new instance of the ResourceAllocationException class with serialized data.
@@ -59,11 +59,12 @@ public ResourceAllocationException(string message, string errorCode, Exception i
/// </summary>
/// <param name="info">The SerializationInfo that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
protected ResourceAllocationException(SerializationInfo info, StreamingContext context)
protected ResourceAllocationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context)
{
}

#endif
#endregion
}
}

0 comments on commit 887ca44

Please sign in to comment.