Show / Hide Table of Contents

Class ExceptionPofSerializer

IPofSerializer implementation that can serialize and deserialize a Exception to/from a POF stream.

Inheritance
object
ExceptionPofSerializer
Implements
IPofSerializer
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Tangosol.IO.Pof
Assembly: Coherence.dll
Syntax
public class ExceptionPofSerializer : IPofSerializer
Remarks

This serializer provides a catch-all mechanism for serializing exceptions. Any deserialized exception will loose type information, and simply be represented as a PortableException. The basic detail information of the exception is retained.

PortableException and this class work asymmetrically to provide the serialization routines for exceptions.

Methods

Deserialize(IPofReader)

Deserialize a user type instance from a POF stream by reading its state using the specified IPofReader object.

Declaration
public object Deserialize(IPofReader reader)
Parameters
Type Name Description
IPofReader reader

The IPofReader with which to read the object's state.

Returns
Type Description
object

The deserialized user type instance.

Remarks

An implementation of IPofSerializer is required to follow the following steps in sequence for reading in an object of a user type:

  1. If the object is evolvable, the implementation must get the version by calling VersionId.
  2. The implementation may read any combination of the properties of the user type by using "read" methods of the IPofReader, but it must do so in the order of the property indexes.
  3. After all desired properties of the user type have been read, the implementation must terminate the reading of the user type by calling ReadRemainder().
Exceptions
Type Condition
IOException

If an I/O error occurs.

Serialize(IPofWriter, object)

Serialize a user type instance to a POF stream by writing its state using the specified IPofWriter object.

Declaration
public void Serialize(IPofWriter writer, object o)
Parameters
Type Name Description
IPofWriter writer

The IPofWriter with which to write the object's state.

object o

The object to serialize.

Remarks

An implementation of IPofSerializer is required to follow the following steps in sequence for writing out an object of a user type:

  1. If the object is evolvable, the implementation must set the version by calling VersionId.
  2. The implementation may write any combination of the properties of the user type by using the "write" methods of the IPofWriter, but it must do so in the order of the property indexes.
  3. After all desired properties of the user type have been written, the implementation must terminate the writing of the user type by calling WriteRemainder(Binary).
Exceptions
Type Condition
IOException

If an I/O error occurs.

WriteException(IPofWriter, Exception)

Write the exception to the specified stream.

Declaration
public static void WriteException(IPofWriter writer, Exception e)
Parameters
Type Name Description
IPofWriter writer

The IPofWriter to write to.

Exception e

The Exception to write.

Implements

IPofSerializer
In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.