System Class Loader Resource Algorithm

In Java docs, I see statements like this:

The bootloader resource of a system class search algorithm is used to search for a resource.

But where can I find out how this "search algorithm" works, especially in the context of Android.

+3
source share
2 answers

you have a hierarchy of class loaders in java, for example:

    Bootstrap CL
        |
        |
    Extension CL
        |
        |
SystemClassLoader CL
        |
        |    
Application Specific CL

When the findClass () method is called, the Loader class usually delegates to it the parent first, which will try to load the class.

eg. if you are trying to load a class that is in the ext folder of your JVM, you can use

Class clazz=ClassLoader.getSystemClassLoader().findClass("org.pack.ExtClass");

, Extension ClassLoader, Bootstrap CL. Bootstrap CL null Extension ClassLoader, , Extension CL . "org.pack.ExtClass" , , SystemClassLoader, clazz .

, , ClassLoader .

, WebApp Tomcat . WebAppClassLoader -. , bootstrap.jar Tomcat Directory CL, , .

:

http://www.developer.com/java/other/article.php/2248831/Java-Class-Loading-The-Basics.htm

http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html

http://www.ibm.com/developerworks/java/library/j-dyn0429/

, ..

+6

Android (Dalvik) PathClassLoader.

, , algo. - JAR .

+2

All Articles