Java Classloader Hierarchy
Classloaders contain a hierarchy with parent classloaders and child
classloaders. The relationship between parent and child classloaders is
analogous to the object relationship of super classes and subclasses.
The bootstrap classloader is the root of the Java classloader hierarchy.
The Java virtual machine (JVM) creates the bootstrap classloader, which
loads the Java development kit (JDK) internal classes and java.*
packages included in the JVM. (For example, the bootstrap classloader
loads java.lang.String.)
The extensions classloader is a child of the bootstrap classloader. The
extensions classloader loads any JAR files placed in the extensions
directory of the JDK. This is a convenient means to extending the JDK
without adding entries to the classpath. However, anything in the
extensions directory must be self-contained and can only refer to
classes in the extensions directory or JDK classes.
The system classpath classloader extends the JDK extensions classloader.
The system classpath classloader loads the classes from the classpath
of the JVM. Application-specific classloaders (including WebLogic Server
classloaders) are children of the system classpath classloader.
Loading a Class
Classloaders use a delegation model when loading a class. The
classloader implementation first checks its cache to see if the
requested class has already been loaded. This class verification
improves performance in that its cached memory copy is used instead of
repeated loading of a class from disk. If the class is not found in its
cache, the current classloader asks its parent for the class. Only if
the parent cannot load the class does the classloader attempt to load
the class. If a class exists in both the parent and child classloaders,
the parent version is loaded. This delegation model is followed to avoid
multiple copies of the same form being loaded. Multiple copies of the
same class can lead to a ClassCastException.
Classloaders ask their parent classloader to load a class before attempting to load the class themselves.
from: http://docs.oracle.com/cd/E15051_01/wls/docs103/programming/classloading.html
分享到:
相关推荐
Java ClassLoader定制实例
java classloader classpath 张孝祥
Java ClassLoader Tutorial
理解Java ClassLoader机制
NULL 博文链接:https://sbiigu.iteye.com/blog/260456
java classloader 讲义-淘宝网
Understanding the Java ClassLoader
java classLoader 的全面讲解 从基本概念到具体的应用 里面共有三份资料。
Understanding the Java ClassLoader.pdf
Sun 官方关于 ClassLoader原理的文章,值得一看
本教程概述了 Java ClassLoader,并指导您构造在装入代码之前自动编译代码的示例 ClassLoader。您将完全了解 ClassLoader 的功能以及创建自己的 ClassLoader 需要执行的操作
破解java加密的ClassLoader.java,在classloader植入破解代码
内容简介: ClassLoader体系结构 类装载器在JVM中并不是唯一的,JVM自带了三个装载器,用户也可以根据自己的需求自定义新的装载器,这些装载器的体系结构可以看作是树状结构,如图1所示:
了解 Java ClassLoader
ClassLoader类加载器讲解,理解JAVA类加载机制
Java ClassLoader 是一个重要的、但又常常被人忽略的 Java 运行时系统组件。它是负责在运行时查找和装入类文件的类。创建自己的 ClassLoader 可以以实用且有趣的方式定制 JVM,这样可以让您彻底重新定义如何将类文件...
深入了解Java_ClassLoader,Bytecde.pdf
主要内容包括 Java类加载机制及加载流程,以及如何定义自己的类加载器,如何实现类的热替换。