Class SerializationPolicy
Serialization policy, providing a central location to obtain ISerializer instances, for example when serializing state during a checkpoint, or when deserializing state from a checkpoint where the persisted state contains a name and version for the serializer that was used to write the state.
Inheritance
Implements
Namespace: Reaqtor.QueryEngine
Assembly: Reaqtor.QueryEngine.Serialization.DataModel.dll
Syntax
public sealed class SerializationPolicy : Object, ISerializationPolicy
Constructors
SerializationPolicy(IExpressionPolicy, Version)
Creates a serialization policy instance with a specified policy on how to handle expression trees, and a default version of the serializer to use.
Declaration
public SerializationPolicy(IExpressionPolicy expressionPolicy, Version defaultVersion)
Parameters
Type | Name | Description |
---|---|---|
IExpressionPolicy | expressionPolicy | The policy for serializing expressions. |
System.Version | defaultVersion | The default version used for new serialization operations. |
Properties
Default
Default version of the serialization policy.
Declaration
public static ISerializationPolicy Default { get; }
Property Value
Type | Description |
---|---|
ISerializationPolicy |
Methods
GetSerializer()
Gets the default serializer. Useful for serialization of new state using the "latest known good" serializer.
Declaration
public ISerializer GetSerializer()
Returns
Type | Description |
---|---|
ISerializer | The serializer instance. |
GetSerializer(String, Version)
Gets a serializer with the specified name
and version
. This is used
when recovering from a checkpoint, where serializer names and versions are stored in order to locate the
right (de)serializer to use for reading the state.
Declaration
public ISerializer GetSerializer(string name, Version version)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the serializer. |
System.Version | version | The version of the serializer. |
Returns
Type | Description |
---|---|
ISerializer | The serializer instance. |