org.apache.hadoop.util
Class ApplicationClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by org.apache.hadoop.util.ApplicationClassLoader
Direct Known Subclasses:
ApplicationClassLoader

@InterfaceAudience.Public
@InterfaceStability.Unstable
public class ApplicationClassLoader
extends URLClassLoader

A URLClassLoader for application isolation. Classes from the application JARs are loaded in preference to the parent loader.


Field Summary
static String SYSTEM_CLASSES_DEFAULT
          Default value of the system classes if the user did not override them.
 
Constructor Summary
ApplicationClassLoader(String classpath, ClassLoader parent, List<String> systemClasses)
           
ApplicationClassLoader(URL[] urls, ClassLoader parent, List<String> systemClasses)
           
 
Method Summary
 URL getResource(String name)
           
static boolean isSystemClass(String name, List<String> systemClasses)
           
 Class<?> loadClass(String name)
           
protected  Class<?> loadClass(String name, boolean resolve)
           
 
Methods inherited from class java.net.URLClassLoader
addURL, definePackage, findClass, findResource, findResources, getPermissions, getURLs, newInstance, newInstance
 
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SYSTEM_CLASSES_DEFAULT

public static final String SYSTEM_CLASSES_DEFAULT
Default value of the system classes if the user did not override them. JDK classes, hadoop classes and resources, and some select third-party classes are considered system classes, and are not loaded by the application classloader.

Constructor Detail

ApplicationClassLoader

public ApplicationClassLoader(URL[] urls,
                              ClassLoader parent,
                              List<String> systemClasses)

ApplicationClassLoader

public ApplicationClassLoader(String classpath,
                              ClassLoader parent,
                              List<String> systemClasses)
                       throws MalformedURLException
Throws:
MalformedURLException
Method Detail

getResource

public URL getResource(String name)
Overrides:
getResource in class ClassLoader

loadClass

public Class<?> loadClass(String name)
                   throws ClassNotFoundException
Overrides:
loadClass in class ClassLoader
Throws:
ClassNotFoundException

loadClass

protected Class<?> loadClass(String name,
                             boolean resolve)
                      throws ClassNotFoundException
Overrides:
loadClass in class ClassLoader
Throws:
ClassNotFoundException

isSystemClass

public static boolean isSystemClass(String name,
                                    List<String> systemClasses)


Copyright © 2014 Apache Software Foundation. All Rights Reserved.