Returns the private class loader that spark uses.

        This is needed since jars added with --jars are not easily resolvable by py4j's classloader
355786
def classloader(self):
        
        return self.jvm.org.apache.spark.util.Utils.getContextOrSparkClassLoader()
1297439
public static ClassLoader getClassLoader() {
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        if (cl == null) {
            cl = ClassLoader.getSystemClassLoader();
            if (cl == null) {
                // When this method is called for initializing a ICU4J class
                // during bootstrap, cl might be still null (other than Android?).
                // In this case, we want to use the bootstrap class loader.
                cl = getBootstrapClassLoader();
            }
        }
        return cl;
    }
424156
public ClassLoader getClassLoader ()
  {
    // To follow the same behavior of Class.forName(...) I had to play
    // dirty (Supported by Sun, IBM & BEA JVMs)
    try
    {
      // Get a reference to this class' class-loader
      final ClassLoader cl = getClass ().getClassLoader ();

      // Create a method instance representing the protected
      // getCallerClassLoader method of class ClassLoader
      final Method mthd = ClassLoader.class.getDeclaredMethod ("getCallerClassLoader", new Class <?> [0]);
      if (false)
      {
        // Make the method accessible.
        AccessibleObject.setAccessible (new AccessibleObject [] { mthd }, true);
      }
      // Try to get the caller's class-loader
      return (ClassLoader) mthd.invoke (cl, new Object [0]);
    }
    catch (final Throwable all)
    {
      // Use this class' class-loader
      return getClass ().getClassLoader ();
    }
  }
901368
@FFDCIgnore(ClassNotFoundException.class)
    private Class<?> findClassCommonLibraryClassLoaders(String name) throws ClassNotFoundException {
        for (LibertyLoader cl : delegateLoaders) {
            try {
                return cl.findClass(name);
            } catch (ClassNotFoundException e) {
                // Ignore. Will throw at the end if class is not found.
            }
        }
        // If we reached here, then the class was not loaded.
        throw new ClassNotFoundException(name);
    }
772768
public static LibraryLoader loader() {
        String type = System.getProperty("com.lambdaworks.jni.loader");

        if (type != null) {
            if (type.equals("sys")) return new SysLibraryLoader();
            if (type.equals("nil")) return new NilLibraryLoader();
            if (type.equals("jar")) return new JarLibraryLoader();
            throw new IllegalStateException("Illegal value for com.lambdaworks.jni.loader: " + type);
        }

        String vmSpec = System.getProperty("java.vm.specification.name");
        return vmSpec.startsWith("Java") ? new JarLibraryLoader() : new SysLibraryLoader();
    }
814987
protected ClassLoader getClassLoader() {
        ClassLoader classLoader = null;
        try {
            classLoader = Thread.currentThread().getContextClassLoader();
        } catch (Throwable ex) {
            // Cannot access thread context ClassLoader - falling back...
        }
        return (classLoader != null ? classLoader : getClass().getClassLoader());
    }
129826
public ClassLoader buildClassLoader(ClassLoader serviceLoader)
  {
    synchronized (_loaderMap) {
      SoftReference<ClassLoader> extLoaderRef = _loaderMap.get(serviceLoader);
      
      if (extLoaderRef != null) {
        ClassLoader extLoader = extLoaderRef.get();
        
        if (extLoader != null) {
          return extLoader;
        }
      }
    }
    
    String parentId = EnvLoader.getEnvironmentName(serviceLoader);
    
    String id = _id + "!" + parentId;
    
    //DynamicClassLoader extLoader = new PodExtClassLoader(serviceLoader, id);
    DynamicClassLoader extLoader = null;

    /*
    LibraryLoader libLoader
      = new LibraryLoader(extLoader, getRootDirectory().lookup("lib"));
    libLoader.init();
    
    CompilingLoader compLoader
      = new CompilingLoader(extLoader, getRootDirectory().lookup("classes"));
    compLoader.init();
    
    synchronized (_loaderMap) {
      SoftReference<ClassLoader> extLoaderRef = _loaderMap.get(serviceLoader);
      
      if (extLoaderRef != null) {
        ClassLoader extLoaderOld = extLoaderRef.get();
        
        if (extLoaderOld != null) {
          return extLoaderOld;
        }
      }
      
      _loaderMap.put(serviceLoader, new SoftReference<>(extLoader));
    }
    */
    
    return extLoader;
  }
504181
public void setClassLoader(final GroovyClassLoader loader) {
        // Classloaders should only be created inside a doPrivileged block in case
        // this method is invoked by code that does not have security permissions
        this.classLoader = loader != null ? loader : AccessController.doPrivileged(new PrivilegedAction<GroovyClassLoader>() {
            public GroovyClassLoader run() {
                ClassLoader parent = Thread.currentThread().getContextClassLoader();
                if (parent == null) parent = ProcessingUnit.class.getClassLoader();
                return new GroovyClassLoader(parent, configuration);
            }
        });
    }
92648
private static ClassLoader extensionClassLoader(final ClassLoader environment) {
    ClassLoader cl = environment;
    ClassLoader prev = null;
    while (cl != null) {
      prev = cl;
      cl = cl.getParent();
    }
    return prev;
  }
1155379
public static EnvironmentClassLoader getEnvironmentClassLoader()
  {
    ClassLoader loader = Thread.currentThread().getContextClassLoader();

    for (; loader != null; loader = loader.getParent()) {
      if (loader instanceof EnvironmentClassLoader) {
        return (EnvironmentClassLoader) loader;
      }
    }
    
    loader = getSystemClassLoader();
    
    if (loader instanceof EnvironmentClassLoader) {
      return (EnvironmentClassLoader) loader;
    }

    return null;
  }
670322
protected static ClassLoader getContextClassLoader()
    {
        if (System.getSecurityManager() != null)
        {
            try
            {
                Object cl = AccessController.doPrivileged(new PrivilegedExceptionAction()
                {
                            public Object run() throws PrivilegedActionException
                            {
                                return Thread.currentThread().getContextClassLoader();
                            }
                });
                return (ClassLoader) cl;
            }
            catch (PrivilegedActionException pae)
            {
                throw new FacesException(pae);
            }
        }
        else
        {
            return Thread.currentThread().getContextClassLoader();
        }
    }
1087880
def get_jclass(classname):
    
    try:
        return javabridge.class_for_name(classname)
    except:
        return javabridge.static_call(
            "Lweka/core/ClassHelper;", "forName",
            "(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Class;",
            javabridge.class_for_name("java.lang.Object"), classname)
441985
static JClassLoader getSystemClassLoader()
  {
    if (_staticClassLoader == null)
      _staticClassLoader = JClassLoaderWrapper.create(ClassLoader.getSystemClassLoader());

    return _staticClassLoader;
  }
112781
private static ClassLoader findClassLoader() throws ConfigurationError {
        // Figure out which ClassLoader to use for loading the provider
        // class.  If there is a Context ClassLoader then use it.

        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();

        if (debug) debugPrintln(
            "Using context class loader: "
            + classLoader);

        if (classLoader == null) {
            // if we have no Context ClassLoader
            // so use the current ClassLoader
            classLoader = FactoryFinder.class.getClassLoader();
            if (debug) debugPrintln(
                "Using the class loader of FactoryFinder: "
                + classLoader);
        }

        return classLoader;
    }
1274486
public static final AccessClassLoader get(Class<?> typeToBeExtended) {

		ClassLoader loader = typeToBeExtended.getClassLoader();
		return get(loader == null ? ClassLoader.getSystemClassLoader() : loader);
	}
330932
public static ClassLoader getThreadContextClassLoader()
    {
        Thread thread=Thread.currentThread();
        ClassLoader classLoader=thread.getContextClassLoader();
        
        return classLoader;
    }
1011380
@Override
    public ClassLoader getClassLoader(String identifier) throws IllegalArgumentException {
        if (identifier == null)
            return null;
        ThreadContextClassLoader classloader = tcclStore.retrieve(identifier);
        if (classloader != null) {
            return classloader;
        }
        return null;
    }