예제 #1
0
        private static ClassLoaderWrapper GetGenericClassLoaderByKey(ClassLoaderWrapper[] key)
        {
            lock (wrapperLock)
            {
                if (genericClassLoaders == null)
                {
                    genericClassLoaders = new List <GenericClassLoader>();
                }
                foreach (GenericClassLoader loader in genericClassLoaders)
                {
                    if (loader.Matches(key))
                    {
                        return(loader);
                    }
                }
                object javaClassLoader = null;
#if !STATIC_COMPILER && !FIRST_PASS && !STUB_GENERATOR
                javaClassLoader = DoPrivileged(new AssemblyClassLoader.CreateAssemblyClassLoader(null));
#endif
                GenericClassLoader newLoader = new GenericClassLoader(key, javaClassLoader);
                SetWrapperForClassLoader(javaClassLoader, newLoader);
                genericClassLoaders.Add(newLoader);
                return(newLoader);
            }
        }
예제 #2
0
 internal string GetName()
 {
     System.Text.StringBuilder sb = new System.Text.StringBuilder();
     sb.Append('[');
     foreach (ClassLoaderWrapper loader in delegates)
     {
         sb.Append('[');
         GenericClassLoader gcl = loader as GenericClassLoader;
         if (gcl != null)
         {
             sb.Append(gcl.GetName());
         }
         else
         {
             sb.Append(((AssemblyClassLoader)loader).MainAssembly.FullName);
         }
         sb.Append(']');
     }
     sb.Append(']');
     return(sb.ToString());
 }