Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 internal ClassDefinitionContext(PortableContext portableContext, int factoryId)
 {
     this._portableContext = portableContext;
     this._factoryId       = factoryId;
 }
 internal PortableSerializer(PortableContext context,
                             IEnumerable <KeyValuePair <int, IPortableFactory> > portableFactories)
 {
     _context   = context;
     _factories = _factories.Union(portableFactories).ToDictionary(x => x.Key, x => x.Value);
 }
 internal ClassDefinitionContext(PortableContext portableContext, int factoryId)
 {
     this._portableContext = portableContext;
     this._factoryId = factoryId;
 }