private static ITransportFactory NewInstance(string scheme)
{
try
{
Type factoryType = FindTransportFactory(scheme);
if(factoryType == null)
{
throw new Exception("NewInstance failed to find a match for id = " + scheme);
}
return (ITransportFactory) Activator.CreateInstance(factoryType);
}
catch(Exception ex)
{
Tracer.WarnFormat("NewInstance failed to create an ITransportFactory with error: {1}", ex.Message);
throw;
}
}