Apache.NMS.NMSConnectionFactory.GetTypeForScheme C# (CSharp) Метод

GetTypeForScheme() приватный статический Метод

Finds the System.Type associated with the given scheme.
private static GetTypeForScheme ( string scheme ) : Type
scheme string The scheme (e.g. tcp, activemq or stomp).
Результат System.Type
        private static Type GetTypeForScheme(string scheme)
        {
            string[] paths = GetConfigSearchPaths();
            string assemblyFileName;
            string factoryClassName;
            Type factoryType = null;

            Tracer.DebugFormat("Locating provider for scheme: {0}", scheme);
            if(LookupConnectionFactoryInfo(paths, scheme, out assemblyFileName, out factoryClassName))
            {
                Assembly assembly = null;

                Tracer.DebugFormat("Attempting to load provider assembly: {0}", assemblyFileName);
                try
                {
                    assembly = Assembly.Load(assemblyFileName);
                    if(null != assembly)
                    {
                        Tracer.Debug("Succesfully loaded provider.");
                    }
                }
                catch(Exception ex)
                {
                    Tracer.ErrorFormat("Exception loading assembly failed: {0}", ex.Message);
                    assembly = null;
                }

                if(null == assembly)
                {
                    foreach(string path in paths)
                    {
                        string fullpath = Path.Combine(path, assemblyFileName) + ".dll";

                        Tracer.DebugFormat("Looking for: {0}", fullpath);
                        if(File.Exists(fullpath))
                        {
                            Tracer.Debug("\tAssembly found!  Attempting to load...");
                            try
                            {
                                assembly = Assembly.LoadFrom(fullpath);
                            }
                            catch(Exception ex)
                            {
                                Tracer.ErrorFormat("Exception loading assembly failed: {0}", ex.Message);
                                assembly = null;
                            }

                            if(null != assembly)
                            {
                                Tracer.Debug("Successfully loaded provider.");
                                break;
                            }

                            Tracer.Debug("Failed to load provider.  Continuing search...");
                        }
                    }
                }

                if(null != assembly)
                {
            #if NETCF
                    factoryType = assembly.GetType(factoryClassName, true);
            #else
                    factoryType = assembly.GetType(factoryClassName, true, true);
            #endif
                    if(null == factoryType)
                    {
                        Tracer.Fatal("Failed to load class factory from provider.");
                    }
                }
                else
                {
                    Tracer.Fatal("Failed to load provider assembly.");
                }
            }

            return factoryType;
        }