PersistableHash() static private method

static private PersistableHash ( string str ) : int
str string
return int
Ejemplo n.º 1
0
        internal TypeWrapper DoLoad(string name)
        {
            TypeWrapper tw = assemblyLoader.DoLoad(name);

            if (tw != null)
            {
                return(RegisterInitiatingLoader(tw));
            }
            LazyInitExports();
            if (exports != null)
            {
                List <int> assemblies;
                if (exports.TryGetValue(JVM.PersistableHash(name), out assemblies))
                {
                    foreach (int index in assemblies)
                    {
                        AssemblyLoader loader = TryGetLoaderByIndex(index);
                        if (loader != null)
                        {
                            tw = loader.DoLoad(name);
                            if (tw != null)
                            {
                                return(RegisterInitiatingLoader(tw));
                            }
                        }
                    }
                }
            }
            return(null);
        }
Ejemplo n.º 2
0
 internal Assembly FindResourceAssembliesImpl(string unmangledName, string name, bool firstOnly, ref List <Assembly> list)
 {
     if (ReflectUtil.IsDynamicAssembly(assemblyLoader.Assembly))
     {
         return(null);
     }
     if (assemblyLoader.Assembly.GetManifestResourceInfo(name) != null)
     {
         if (firstOnly)
         {
             return(assemblyLoader.Assembly);
         }
         list = new List <Assembly>();
         list.Add(assemblyLoader.Assembly);
     }
     LazyInitExports();
     if (exports != null)
     {
         List <int> assemblies;
         if (exports.TryGetValue(JVM.PersistableHash(unmangledName), out assemblies))
         {
             foreach (int index in assemblies)
             {
                 AssemblyLoader loader = exportedAssemblies[index];
                 if (loader == null)
                 {
                     Assembly asm = LoadAssemblyOrClearName(ref exportedAssemblyNames[index], true);
                     if (asm == null)
                     {
                         continue;
                     }
                     loader = exportedAssemblies[index] = GetLoaderForExportedAssembly(asm);
                 }
                 if (loader.Assembly.GetManifestResourceInfo(name) != null)
                 {
                     if (firstOnly)
                     {
                         return(loader.Assembly);
                     }
                     if (list == null)
                     {
                         list = new List <Assembly>();
                     }
                     list.Add(loader.Assembly);
                 }
             }
         }
     }
     return(null);
 }
Ejemplo n.º 3
0
        internal TypeWrapper DoLoad(string name)
        {
            TypeWrapper tw = assemblyLoader.DoLoad(name);

            if (tw != null)
            {
                return(RegisterInitiatingLoader(tw));
            }
            LazyInitExports();
            if (exports != null)
            {
                List <int> assemblies;
                if (exports.TryGetValue(JVM.PersistableHash(name), out assemblies))
                {
                    foreach (int index in assemblies)
                    {
                        AssemblyLoader loader = exportedAssemblies[index];
                        if (loader == null)
                        {
                            Assembly asm = LoadAssemblyOrClearName(ref exportedAssemblyNames[index], true);
                            if (asm == null)
                            {
                                continue;
                            }
                            loader = exportedAssemblies[index] = GetLoaderForExportedAssembly(asm);
                        }
                        tw = loader.DoLoad(name);
                        if (tw != null)
                        {
                            return(RegisterInitiatingLoader(tw));
                        }
                    }
                }
            }
            return(null);
        }
Ejemplo n.º 4
0
        private IEnumerable <java.net.URL> GetResourcesImpl(string unmangledName, bool getFromDelegates)
        {
            if (ReflectUtil.IsDynamicAssembly(assemblyLoader.Assembly))
            {
                yield break;
            }
#if !FIRST_PASS
            java.util.Enumeration urls = assemblyLoader.FindResources(unmangledName);
            while (urls.hasMoreElements())
            {
                yield return((java.net.URL)urls.nextElement());
            }
#endif
            string name = JVM.MangleResourceName(unmangledName);
            if (assemblyLoader.Assembly.GetManifestResourceInfo(name) != null)
            {
                yield return(MakeResourceURL(assemblyLoader.Assembly, name));
            }
            LazyInitExports();
            if (exports != null)
            {
                List <int> assemblies;
                if (exports.TryGetValue(JVM.PersistableHash(unmangledName), out assemblies))
                {
                    foreach (int index in assemblies)
                    {
                        AssemblyLoader loader = exportedAssemblies[index];
                        if (loader == null)
                        {
                            Assembly asm = LoadAssemblyOrClearName(ref exportedAssemblyNames[index], true);
                            if (asm == null)
                            {
                                continue;
                            }
                            loader = exportedAssemblies[index] = GetLoaderForExportedAssembly(asm);
                        }
#if !FIRST_PASS
                        urls = loader.FindResources(unmangledName);
                        while (urls.hasMoreElements())
                        {
                            yield return((java.net.URL)urls.nextElement());
                        }
#endif
                        if (loader.Assembly.GetManifestResourceInfo(name) != null)
                        {
                            yield return(MakeResourceURL(loader.Assembly, name));
                        }
                    }
                }
            }
            if (!getFromDelegates)
            {
                yield break;
            }
            for (int i = 0; i < delegates.Length; i++)
            {
                if (delegates[i] == null)
                {
                    Assembly asm = LoadAssemblyOrClearName(ref references[i], false);
                    if (asm != null)
                    {
                        delegates[i] = AssemblyClassLoader.FromAssembly(asm);
                    }
                }
                if (delegates[i] != null)
                {
                    foreach (java.net.URL url in delegates[i].FindResources(unmangledName))
                    {
                        yield return(url);
                    }
                }
            }
            if (!assemblyLoader.HasJavaModule)
            {
                foreach (java.net.URL url in GetBootstrapClassLoader().FindResources(unmangledName))
                {
                    yield return(url);
                }
            }
        }