private void AddConfigDataSerializableFactories(
     IDictionary <int, IDataSerializableFactory> dataSerializableFactories, SerializationConfig config)
 {
     foreach (var entry in config.GetDataSerializableFactories())
     {
         int factoryId = entry.Key;
         IDataSerializableFactory factory = entry.Value;
         if (factoryId <= 0)
         {
             throw new ArgumentException("IDataSerializableFactory factoryId must be positive! -> " + factory);
         }
         if (dataSerializableFactories.ContainsKey(factoryId))
         {
             throw new ArgumentException("IDataSerializableFactory with factoryId '" + factoryId +
                                         "' is already registered!");
         }
         dataSerializableFactories.Add(factoryId, factory);
     }
     foreach (var entry in config.GetDataSerializableFactoryClasses())
     {
         int    factoryId        = entry.Key;
         string factoryClassName = entry.Value;
         if (factoryId <= 0)
         {
             throw new ArgumentException("IDataSerializableFactory factoryId must be positive! -> " +
                                         factoryClassName);
         }
         if (dataSerializableFactories.ContainsKey(factoryId))
         {
             throw new ArgumentException("IDataSerializableFactory with factoryId '" + factoryId +
                                         "' is already registered!");
         }
         IDataSerializableFactory factory = null;
         try
         {
             Type type = Type.GetType(factoryClassName);
             if (type != null)
             {
                 factory = Activator.CreateInstance(type) as IDataSerializableFactory;
             }
         }
         catch (Exception e)
         {
             //ClassLoaderUtil.newInstance(cl, factoryClassName);
             throw new HazelcastSerializationException(e);
         }
         dataSerializableFactories.Add(factoryId, factory);
     }
     foreach (IDataSerializableFactory f in dataSerializableFactories.Values)
     {
         var aware = f as IHazelcastInstanceAware;
         if (aware != null)
         {
             aware.SetHazelcastInstance(_hazelcastInstance);
         }
     }
 }