Apache.NMS.ActiveMQ.Transport.TransportFactory.NewInstance C# (CSharp) Method

NewInstance() private static method

private static NewInstance ( string scheme ) : ITransportFactory
scheme string
return ITransportFactory
        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;
            }
        }