internal SerializationService(IInputOutputFactory inputOutputFactory, int version, IDictionary <int, IDataSerializableFactory> dataSerializableFactories, IDictionary <int, IPortableFactory> portableFactories, ICollection <IClassDefinition> classDefinitions, bool checkClassDefErrors, IManagedContext managedContext, IPartitioningStrategy partitionStrategy, int initialOutputBufferSize, bool enableCompression, bool enableSharedObject) { _inputOutputFactory = inputOutputFactory; _managedContext = managedContext; GlobalPartitioningStrategy = partitionStrategy; _outputBufferSize = initialOutputBufferSize; _bufferPoolThreadLocal = new BufferPoolThreadLocal(this); _portableContext = new PortableContext(this, version); _dataSerializerAdapter = CreateSerializerAdapterByGeneric <IIdentifiedDataSerializable>( new DataSerializer(dataSerializableFactories)); _portableSerializer = new PortableSerializer(_portableContext, portableFactories); _portableSerializerAdapter = CreateSerializerAdapterByGeneric <IPortable>(_portableSerializer); _nullSerializerAdapter = CreateSerializerAdapterByGeneric <object>(new ConstantSerializers.NullSerializer()); _serializableSerializerAdapter = CreateSerializerAdapterByGeneric <object>(new DefaultSerializers.SerializableSerializer()); RegisterConstantSerializers(); RegisterDefaultSerializers(); RegisterClassDefinitions(classDefinitions, checkClassDefErrors); }
internal SerializationService(IInputOutputFactory inputOutputFactory, int version, IDictionary <int, IDataSerializableFactory> dataSerializableFactories, IDictionary <int, IPortableFactory> portableFactories, ICollection <IClassDefinition> classDefinitions, SerializerHooks hooks, IEnumerable <ISerializerDefinitions> definitions, bool checkClassDefErrors, IPartitioningStrategy partitioningStrategy, int initialOutputBufferSize, ILoggerFactory loggerFactory) { _logger = loggerFactory.CreateLogger <SerializationService>(); _inputOutputFactory = inputOutputFactory; GlobalPartitioningStrategy = partitioningStrategy; _outputBufferSize = initialOutputBufferSize; _bufferPoolThreadLocal = new BufferPoolThreadLocal(this); _portableContext = new PortableContext(this, version); // create data serializer (will be added as constant) var dataSerializer = new DataSerializer(hooks, dataSerializableFactories, loggerFactory); _dataSerializerAdapter = CreateSerializerAdapter <IIdentifiedDataSerializable>(dataSerializer); // create portable serializer (will be added as constant) _portableSerializer = new PortableSerializer(_portableContext, portableFactories); _portableSerializerAdapter = CreateSerializerAdapter <IPortable>(_portableSerializer); // create the serializer of null objects (will be added as constant) _nullSerializerAdapter = CreateSerializerAdapter <object>(new NullSerializer()); // create the serializable adapter (will be added as constant) _serializableSerializerAdapter = CreateSerializerAdapter <object>(new SerializableSerializer()); // add defined serializers foreach (var definition in definitions) { definition.AddSerializers(this); } // add constant serializers AddMoreSerializers(); // add class definitions RegisterClassDefinitions(classDefinitions, checkClassDefErrors); }
internal SerializationService(IInputOutputFactory inputOutputFactory, int version, IDictionary <int, IDataSerializableFactory> dataSerializableFactories, IDictionary <int, IPortableFactory> portableFactories, ICollection <IClassDefinition> classDefinitions, bool checkClassDefErrors, IManagedContext managedContext, IPartitioningStrategy partitionStrategy, int initialOutputBufferSize, bool enableCompression, bool enableSharedObject) { this.inputOutputFactory = inputOutputFactory; this.managedContext = managedContext; globalPartitioningStrategy = partitionStrategy; outputBufferSize = initialOutputBufferSize; dataOutputQueue = new ThreadLocalOutputCache(this); portableContext = new PortableContext(this, version); dataSerializerAdapter = CreateSerializerAdapterByGeneric <IDataSerializable>(new DataSerializer(dataSerializableFactories)); portableSerializer = new PortableSerializer(portableContext, portableFactories); portableSerializerAdapter = CreateSerializerAdapterByGeneric <IPortable>(portableSerializer); RegisterConstantSerializers(); RegisterDefaultSerializers(); RegisterClassDefinitions(classDefinitions, checkClassDefErrors); }