public static int GetSerializerIdentifierFromConfig(Type type, ExtendedActorSystem system)
{
var config = system.Settings.Config.GetConfig(SerializationIdentifiers);
var identifiers = config.AsEnumerable()
.ToDictionary(pair => Type.GetType(pair.Key, true), pair => pair.Value.GetInt());
int value;
if (identifiers.TryGetValue(type, out value))
{
return value;
}
else
{
throw new ArgumentException(string.Format("Couldn't find serializer id for [{0}] under [{1}] HOCON path", type, SerializationIdentifiers));
}
}
}