JVM中类加载器系统(类加载过程、类加载器分类及ClassLoader)

    科技2024-08-05  26

    文章目录

    类加载器系统类加载过程1.加载2.连接3.初始化 类加载器的分类1.启动类加载器(引导类加载器,Bootstrap ClassLoader)2.扩展类加载器(Extension ClassLoader)3.应用程序类加载器(系统类加载器,AppclassLoader)4.自定义类加载器 ClassLoader

    类加载器系统

    类加载器子系统负责从文件系统或者网络中加载class文件,class文件在文件开头有特定的文件标识。ClassLoader只负责class文件的加载,至于他是否可以运行,则由ExecutionEngine决定。加载的类信息存放于一块称为方法区的内存空间。除了类的信息外,方法区中还会存放运行时常量池信息,可能还包括字符串字面量和数字常量(这部分常量信息是Class文件中常量池部分的内存映射)。

    ClassLoader

    class file存在于本地硬盘上,可以理解为设计师画在纸上的模板,而最终这个模板在执行的时候是要加载到JVM当中来根据这个文件实例化出n个一模一样的实例。class file加载到JVM中,被称为DNA元数据模板,放在方法区。在.class文件-> JVM->最终成为元数据模板,此过程就要一个运输工具(类装载器class Loader),扮演一个快递员的角色。

    类加载过程

    1.加载

    通过一个类的全限定名获取定义此类的二进制字节流

    将这个字节流所代表的静态存储结构转化为方法区的运行时数据结构

    在内存中生成一个代表这个类的java.lang.Class对象,作为方法区这个类的各种数据的访问入口

    补充:加载.class文件的方式

    从本地系统中直接加载通过网络获取,典型场景: web Applet从zip压缩包中读取,成为日后jar、war格式的基础运行时计算生成,使用最多的是:动态代理技术由其他文件生成,典型场景:JSP应用从专有数据库中提取.class文件,比较少见从加密文件中获取,典型的防class文件被反编译的保护措施

    2.连接

    验证(Verify):

    目的在于确保class文件的字节流中包含信息符合当前虚拟机要求,保证被加载类的正确性,不会危害虚拟机自身安全。

    主要包括四种验证,文件格式验证,元数据验证,字节码验证,符号引用验证。

    准备(Prepare) :

    为类变量分配内存并且设置该类变量的默认初始值,即零值。这里不包含用final修饰的static,因为final在编译的时候就会分配了,准备阶段会显式初始化;这里不会为实例变量分配初始化,类变量会分配在方法区中,而实例变量是会随着对象一起分配到Java堆中。

    解析(Resolve):

    将常量池内的符号引用转换为直接引用的过程。事实上,解析操作往往会伴随着JVM在执行完初始化之后再执行。符号引用就是一组符号来描述所引用的目标。符号引用的字面量形式明确定义在《java.虚拟机规范》的class文件格式中。直接引用就是直接指向目标的指针、相对偏移量或一个间接定位到目标的句柄。解析动作主要针对类或接口、字段、类方法、接口方法、方法类型等。对应常量池中的 CONSTANT Class info、CONSTANT Fieldref info、CONSTANT Methodref info等。

    3.初始化

    初始化阶段就是执行类构造器方法()的过程。此方法不需定义,是javac编译器自动收集类中的所有类变量的赋值动作和静态代码块中的语句合并而来。构造器方法中指令按语句在源文件中出现的顺序执行。()不同于类的构造器。(关联:构造器是虚拟机视角下的())若该类具有父类,JVM会保证子类的()执行前,父类的()已经执行完毕。虚拟机必须保证一个类的()方法在多线程下被同步加锁。

    类加载器的分类

    JVM支持两种类型的类加载器,分别为引导类加载器(Bootstrap ClassLoader)和自定义类加载器(User-Defined ClassLoader)。

    从概念上来讲,自定义类加载器一般指的是程序中由开发人员自定义的一类类加载器,但是Java虚拟机规范却没有这么定义,而是将所有派生于抽象类ClassLoader的类加教器都划分为自定义类加载器。

    无论类加载器的类型如何划分,在程序中我们最常见的类加载器始终只有3个,如下所示:

    #mermaid-svg-KbGIoVjtEjwoi8WX .label{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);fill:#333;color:#333}#mermaid-svg-KbGIoVjtEjwoi8WX .label text{fill:#333}#mermaid-svg-KbGIoVjtEjwoi8WX .node rect,#mermaid-svg-KbGIoVjtEjwoi8WX .node circle,#mermaid-svg-KbGIoVjtEjwoi8WX .node ellipse,#mermaid-svg-KbGIoVjtEjwoi8WX .node polygon,#mermaid-svg-KbGIoVjtEjwoi8WX .node path{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-KbGIoVjtEjwoi8WX .node .label{text-align:center;fill:#333}#mermaid-svg-KbGIoVjtEjwoi8WX .node.clickable{cursor:pointer}#mermaid-svg-KbGIoVjtEjwoi8WX .arrowheadPath{fill:#333}#mermaid-svg-KbGIoVjtEjwoi8WX .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-svg-KbGIoVjtEjwoi8WX .flowchart-link{stroke:#333;fill:none}#mermaid-svg-KbGIoVjtEjwoi8WX .edgeLabel{background-color:#e8e8e8;text-align:center}#mermaid-svg-KbGIoVjtEjwoi8WX .edgeLabel rect{opacity:0.9}#mermaid-svg-KbGIoVjtEjwoi8WX .edgeLabel span{color:#333}#mermaid-svg-KbGIoVjtEjwoi8WX .cluster rect{fill:#ffffde;stroke:#aa3;stroke-width:1px}#mermaid-svg-KbGIoVjtEjwoi8WX .cluster text{fill:#333}#mermaid-svg-KbGIoVjtEjwoi8WX div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:12px;background:#ffffde;border:1px solid #aa3;border-radius:2px;pointer-events:none;z-index:100}#mermaid-svg-KbGIoVjtEjwoi8WX .actor{stroke:#ccf;fill:#ECECFF}#mermaid-svg-KbGIoVjtEjwoi8WX text.actor>tspan{fill:#000;stroke:none}#mermaid-svg-KbGIoVjtEjwoi8WX .actor-line{stroke:grey}#mermaid-svg-KbGIoVjtEjwoi8WX .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333}#mermaid-svg-KbGIoVjtEjwoi8WX .messageLine1{stroke-width:1.5;stroke-dasharray:2, 2;stroke:#333}#mermaid-svg-KbGIoVjtEjwoi8WX #arrowhead path{fill:#333;stroke:#333}#mermaid-svg-KbGIoVjtEjwoi8WX .sequenceNumber{fill:#fff}#mermaid-svg-KbGIoVjtEjwoi8WX #sequencenumber{fill:#333}#mermaid-svg-KbGIoVjtEjwoi8WX #crosshead path{fill:#333;stroke:#333}#mermaid-svg-KbGIoVjtEjwoi8WX .messageText{fill:#333;stroke:#333}#mermaid-svg-KbGIoVjtEjwoi8WX .labelBox{stroke:#ccf;fill:#ECECFF}#mermaid-svg-KbGIoVjtEjwoi8WX .labelText,#mermaid-svg-KbGIoVjtEjwoi8WX .labelText>tspan{fill:#000;stroke:none}#mermaid-svg-KbGIoVjtEjwoi8WX .loopText,#mermaid-svg-KbGIoVjtEjwoi8WX .loopText>tspan{fill:#000;stroke:none}#mermaid-svg-KbGIoVjtEjwoi8WX .loopLine{stroke-width:2px;stroke-dasharray:2, 2;stroke:#ccf;fill:#ccf}#mermaid-svg-KbGIoVjtEjwoi8WX .note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-KbGIoVjtEjwoi8WX .noteText,#mermaid-svg-KbGIoVjtEjwoi8WX .noteText>tspan{fill:#000;stroke:none}#mermaid-svg-KbGIoVjtEjwoi8WX .activation0{fill:#f4f4f4;stroke:#666}#mermaid-svg-KbGIoVjtEjwoi8WX .activation1{fill:#f4f4f4;stroke:#666}#mermaid-svg-KbGIoVjtEjwoi8WX .activation2{fill:#f4f4f4;stroke:#666}#mermaid-svg-KbGIoVjtEjwoi8WX .mermaid-main-font{font-family:"trebuchet ms", verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-KbGIoVjtEjwoi8WX .section{stroke:none;opacity:0.2}#mermaid-svg-KbGIoVjtEjwoi8WX .section0{fill:rgba(102,102,255,0.49)}#mermaid-svg-KbGIoVjtEjwoi8WX .section2{fill:#fff400}#mermaid-svg-KbGIoVjtEjwoi8WX .section1,#mermaid-svg-KbGIoVjtEjwoi8WX .section3{fill:#fff;opacity:0.2}#mermaid-svg-KbGIoVjtEjwoi8WX .sectionTitle0{fill:#333}#mermaid-svg-KbGIoVjtEjwoi8WX .sectionTitle1{fill:#333}#mermaid-svg-KbGIoVjtEjwoi8WX .sectionTitle2{fill:#333}#mermaid-svg-KbGIoVjtEjwoi8WX .sectionTitle3{fill:#333}#mermaid-svg-KbGIoVjtEjwoi8WX .sectionTitle{text-anchor:start;font-size:11px;text-height:14px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-KbGIoVjtEjwoi8WX .grid .tick{stroke:#d3d3d3;opacity:0.8;shape-rendering:crispEdges}#mermaid-svg-KbGIoVjtEjwoi8WX .grid .tick text{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-KbGIoVjtEjwoi8WX .grid path{stroke-width:0}#mermaid-svg-KbGIoVjtEjwoi8WX .today{fill:none;stroke:red;stroke-width:2px}#mermaid-svg-KbGIoVjtEjwoi8WX .task{stroke-width:2}#mermaid-svg-KbGIoVjtEjwoi8WX .taskText{text-anchor:middle;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-KbGIoVjtEjwoi8WX .taskText:not([font-size]){font-size:11px}#mermaid-svg-KbGIoVjtEjwoi8WX .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-KbGIoVjtEjwoi8WX .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-svg-KbGIoVjtEjwoi8WX .task.clickable{cursor:pointer}#mermaid-svg-KbGIoVjtEjwoi8WX .taskText.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-KbGIoVjtEjwoi8WX .taskTextOutsideLeft.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-KbGIoVjtEjwoi8WX .taskTextOutsideRight.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-KbGIoVjtEjwoi8WX .taskText0,#mermaid-svg-KbGIoVjtEjwoi8WX .taskText1,#mermaid-svg-KbGIoVjtEjwoi8WX .taskText2,#mermaid-svg-KbGIoVjtEjwoi8WX .taskText3{fill:#fff}#mermaid-svg-KbGIoVjtEjwoi8WX .task0,#mermaid-svg-KbGIoVjtEjwoi8WX .task1,#mermaid-svg-KbGIoVjtEjwoi8WX .task2,#mermaid-svg-KbGIoVjtEjwoi8WX .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-svg-KbGIoVjtEjwoi8WX .taskTextOutside0,#mermaid-svg-KbGIoVjtEjwoi8WX .taskTextOutside2{fill:#000}#mermaid-svg-KbGIoVjtEjwoi8WX .taskTextOutside1,#mermaid-svg-KbGIoVjtEjwoi8WX .taskTextOutside3{fill:#000}#mermaid-svg-KbGIoVjtEjwoi8WX .active0,#mermaid-svg-KbGIoVjtEjwoi8WX .active1,#mermaid-svg-KbGIoVjtEjwoi8WX .active2,#mermaid-svg-KbGIoVjtEjwoi8WX .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-svg-KbGIoVjtEjwoi8WX .activeText0,#mermaid-svg-KbGIoVjtEjwoi8WX .activeText1,#mermaid-svg-KbGIoVjtEjwoi8WX .activeText2,#mermaid-svg-KbGIoVjtEjwoi8WX .activeText3{fill:#000 !important}#mermaid-svg-KbGIoVjtEjwoi8WX .done0,#mermaid-svg-KbGIoVjtEjwoi8WX .done1,#mermaid-svg-KbGIoVjtEjwoi8WX .done2,#mermaid-svg-KbGIoVjtEjwoi8WX .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-svg-KbGIoVjtEjwoi8WX .doneText0,#mermaid-svg-KbGIoVjtEjwoi8WX .doneText1,#mermaid-svg-KbGIoVjtEjwoi8WX .doneText2,#mermaid-svg-KbGIoVjtEjwoi8WX .doneText3{fill:#000 !important}#mermaid-svg-KbGIoVjtEjwoi8WX .crit0,#mermaid-svg-KbGIoVjtEjwoi8WX .crit1,#mermaid-svg-KbGIoVjtEjwoi8WX .crit2,#mermaid-svg-KbGIoVjtEjwoi8WX .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-svg-KbGIoVjtEjwoi8WX .activeCrit0,#mermaid-svg-KbGIoVjtEjwoi8WX .activeCrit1,#mermaid-svg-KbGIoVjtEjwoi8WX .activeCrit2,#mermaid-svg-KbGIoVjtEjwoi8WX .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-svg-KbGIoVjtEjwoi8WX .doneCrit0,#mermaid-svg-KbGIoVjtEjwoi8WX .doneCrit1,#mermaid-svg-KbGIoVjtEjwoi8WX .doneCrit2,#mermaid-svg-KbGIoVjtEjwoi8WX .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-svg-KbGIoVjtEjwoi8WX .milestone{transform:rotate(45deg) scale(0.8, 0.8)}#mermaid-svg-KbGIoVjtEjwoi8WX .milestoneText{font-style:italic}#mermaid-svg-KbGIoVjtEjwoi8WX .doneCritText0,#mermaid-svg-KbGIoVjtEjwoi8WX .doneCritText1,#mermaid-svg-KbGIoVjtEjwoi8WX .doneCritText2,#mermaid-svg-KbGIoVjtEjwoi8WX .doneCritText3{fill:#000 !important}#mermaid-svg-KbGIoVjtEjwoi8WX .activeCritText0,#mermaid-svg-KbGIoVjtEjwoi8WX .activeCritText1,#mermaid-svg-KbGIoVjtEjwoi8WX .activeCritText2,#mermaid-svg-KbGIoVjtEjwoi8WX .activeCritText3{fill:#000 !important}#mermaid-svg-KbGIoVjtEjwoi8WX .titleText{text-anchor:middle;font-size:18px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-KbGIoVjtEjwoi8WX g.classGroup text{fill:#9370db;stroke:none;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:10px}#mermaid-svg-KbGIoVjtEjwoi8WX g.classGroup text .title{font-weight:bolder}#mermaid-svg-KbGIoVjtEjwoi8WX g.clickable{cursor:pointer}#mermaid-svg-KbGIoVjtEjwoi8WX g.classGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-KbGIoVjtEjwoi8WX g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-KbGIoVjtEjwoi8WX .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5}#mermaid-svg-KbGIoVjtEjwoi8WX .classLabel .label{fill:#9370db;font-size:10px}#mermaid-svg-KbGIoVjtEjwoi8WX .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-KbGIoVjtEjwoi8WX .dashed-line{stroke-dasharray:3}#mermaid-svg-KbGIoVjtEjwoi8WX #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-KbGIoVjtEjwoi8WX #compositionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-KbGIoVjtEjwoi8WX #aggregationStart{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-KbGIoVjtEjwoi8WX #aggregationEnd{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-KbGIoVjtEjwoi8WX #dependencyStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-KbGIoVjtEjwoi8WX #dependencyEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-KbGIoVjtEjwoi8WX #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-KbGIoVjtEjwoi8WX #extensionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-KbGIoVjtEjwoi8WX .commit-id,#mermaid-svg-KbGIoVjtEjwoi8WX .commit-msg,#mermaid-svg-KbGIoVjtEjwoi8WX .branch-label{fill:lightgrey;color:lightgrey;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-KbGIoVjtEjwoi8WX .pieTitleText{text-anchor:middle;font-size:25px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-KbGIoVjtEjwoi8WX .slice{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-KbGIoVjtEjwoi8WX g.stateGroup text{fill:#9370db;stroke:none;font-size:10px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-KbGIoVjtEjwoi8WX g.stateGroup text{fill:#9370db;fill:#333;stroke:none;font-size:10px}#mermaid-svg-KbGIoVjtEjwoi8WX g.statediagram-cluster .cluster-label text{fill:#333}#mermaid-svg-KbGIoVjtEjwoi8WX g.stateGroup .state-title{font-weight:bolder;fill:#000}#mermaid-svg-KbGIoVjtEjwoi8WX g.stateGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-KbGIoVjtEjwoi8WX g.stateGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-KbGIoVjtEjwoi8WX .transition{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-KbGIoVjtEjwoi8WX .stateGroup .composit{fill:white;border-bottom:1px}#mermaid-svg-KbGIoVjtEjwoi8WX .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px}#mermaid-svg-KbGIoVjtEjwoi8WX .state-note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-KbGIoVjtEjwoi8WX .state-note text{fill:black;stroke:none;font-size:10px}#mermaid-svg-KbGIoVjtEjwoi8WX .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.7}#mermaid-svg-KbGIoVjtEjwoi8WX .edgeLabel text{fill:#333}#mermaid-svg-KbGIoVjtEjwoi8WX .stateLabel text{fill:#000;font-size:10px;font-weight:bold;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-KbGIoVjtEjwoi8WX .node circle.state-start{fill:black;stroke:black}#mermaid-svg-KbGIoVjtEjwoi8WX .node circle.state-end{fill:black;stroke:white;stroke-width:1.5}#mermaid-svg-KbGIoVjtEjwoi8WX #statediagram-barbEnd{fill:#9370db}#mermaid-svg-KbGIoVjtEjwoi8WX .statediagram-cluster rect{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-KbGIoVjtEjwoi8WX .statediagram-cluster rect.outer{rx:5px;ry:5px}#mermaid-svg-KbGIoVjtEjwoi8WX .statediagram-state .divider{stroke:#9370db}#mermaid-svg-KbGIoVjtEjwoi8WX .statediagram-state .title-state{rx:5px;ry:5px}#mermaid-svg-KbGIoVjtEjwoi8WX .statediagram-cluster.statediagram-cluster .inner{fill:white}#mermaid-svg-KbGIoVjtEjwoi8WX .statediagram-cluster.statediagram-cluster-alt .inner{fill:#e0e0e0}#mermaid-svg-KbGIoVjtEjwoi8WX .statediagram-cluster .inner{rx:0;ry:0}#mermaid-svg-KbGIoVjtEjwoi8WX .statediagram-state rect.basic{rx:5px;ry:5px}#mermaid-svg-KbGIoVjtEjwoi8WX .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#efefef}#mermaid-svg-KbGIoVjtEjwoi8WX .note-edge{stroke-dasharray:5}#mermaid-svg-KbGIoVjtEjwoi8WX .statediagram-note rect{fill:#fff5ad;stroke:#aa3;stroke-width:1px;rx:0;ry:0}:root{--mermaid-font-family: '"trebuchet ms", verdana, arial';--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive}#mermaid-svg-KbGIoVjtEjwoi8WX .error-icon{fill:#522}#mermaid-svg-KbGIoVjtEjwoi8WX .error-text{fill:#522;stroke:#522}#mermaid-svg-KbGIoVjtEjwoi8WX .edge-thickness-normal{stroke-width:2px}#mermaid-svg-KbGIoVjtEjwoi8WX .edge-thickness-thick{stroke-width:3.5px}#mermaid-svg-KbGIoVjtEjwoi8WX .edge-pattern-solid{stroke-dasharray:0}#mermaid-svg-KbGIoVjtEjwoi8WX .edge-pattern-dashed{stroke-dasharray:3}#mermaid-svg-KbGIoVjtEjwoi8WX .edge-pattern-dotted{stroke-dasharray:2}#mermaid-svg-KbGIoVjtEjwoi8WX .marker{fill:#333}#mermaid-svg-KbGIoVjtEjwoi8WX .marker.cross{stroke:#333} :root { --mermaid-font-family: "trebuchet ms", verdana, arial;} #mermaid-svg-KbGIoVjtEjwoi8WX { color: rgba(0, 0, 0, 0.75); font: ; } Extension Class Loader Bootstrap Class Loader System Class Loader User Defined Class Loader

    四者之间的关系是包含关系。不是上下层个,也不是父子类的继承关系。

    public class ClassLoaderTest { public static void main(String[] args) { //获取系统类加载器 ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader(); System.out.println(systemClassLoader);//sun.misc.Launcher$AppClassLoader@18b4aac2 //获取其上层:扩展类加载器 ClassLoader extClassLoader = systemClassLoader.getParent(); System.out.println(extClassLoader);//sun.misc.Launcher$ExtClassLoader@4554617c //获取其上层:获取不到引导类加载器 ClassLoader bootstrapClassLoader = extClassLoader.getParent(); System.out.println(bootstrapClassLoader);//null //对于用户自定义类来说:默认使用系统类加载器进行加载 ClassLoader classLoader = ClassLoaderTest.class.getClassLoader(); System.out.println(classLoader);//sun.misc.Launcher$AppClassLoader@18b4aac2 //String类使用引导类加载器进行加载的。java的核心类库都是使用引导类加载器进行加载的 ClassLoader classLoader1 = String.class.getClassLoader(); System.out.println(classLoader1);//null } }

    1.启动类加载器(引导类加载器,Bootstrap ClassLoader)

    这个类加载使用C/C++语言实现的,嵌套在JVM内部。它用来加载Java的核心库(JAVA_HOME/jre/lib/rt.jar、resources.jar或sun.boot.class.path路径下的内容),用于提供 JVM自身需要的类并不继承自java.lang.classLoader,没有父加载器。加载扩展类和应用程序类加载器,并指定为他们的父类加载器。出于安全考虑,Bootstrap启动类加载器只加载包名为java、javax、sun等开头的类

    2.扩展类加载器(Extension ClassLoader)

    Java语言编写,由sun.misc.Launcher$ExtClassLoader实现。派生于classLoader类父类加载器为启动类加载器从java.ext.dirs系统属性所指定的目录中加载类库,或从JDK的安装目录的jre/lib/ext子目录(扩展目录)下加载类库。如果用户创建的JAR放在此目录下,也会自动由扩展类加载器加载。

    3.应用程序类加载器(系统类加载器,AppclassLoader)

    java语言编写,由sun.misc.Launcher$AppClassLoader实现派生于classLoader类父类加载器为扩展类加载器它负责加载环境变量classpath或系统属性java.class.pat指定路径下的类库该类加载是程序中默认的类加载器,一般来说,Java应用的类都是由它来完成加载通过ClassLoader#getSystemClassLoader()方法可以获取到该类加载器 public class ClassLoaderTest1 { public static void main(String[] args) { System.out.println("---------启动类加载器-----------"); //获取BootstrapClassLoader能够加载的api的路径 URL[] urLs = Launcher.getBootstrapClassPath().getURLs(); for (URL element:urLs){ System.out.println(element.toExternalForm()); } //从上面的路径中随意选择一个类,来看看他的类加载器是着什么:引导类加载器。引导类加载器是不能获取的 ClassLoader classLoader = Provider.class.getClassLoader(); System.out.println(classLoader);//null System.out.println("--------扩展类加载器----------"); String extDirs = System.getProperty("java.ext.dirs"); for (String path:extDirs.split(";")){ System.out.println(path); } //从上面的路径中随意选择一个类,来看看他的类加载器是着什么:扩展类加载器 ClassLoader classLoader1 = CurveDB.class.getClassLoader(); System.out.println(classLoader1);//sun.misc.Launcher$ExtClassLoader@7ea987ac } }

    4.自定义类加载器

    自定义类的加载常常是通过上述三种类加载器互相配合执行的,必要时可以自定义类加载器。

    为什么要自定义类加载器?

    隔离加载类。防止类名和类路径一样是发生的冲突修改类的加载方式。Bootstrap ClassLoader是必须使用,但是可以按需求使用扩展类加载器和应用程序类加载器扩展加载源。从其他地方加载字节码(如数据库中)防止源码泄露。将字节码文件加密,使用自定义类加载器进行解密加载到内存

    ClassLoader

    ClassLoader类,是一个抽象类,其后所有的类加载器(除启动类加载器)都是继承自ClassLoader。获取类加载器的方式: public class ClassLoaderTest2 { public static void main(String[] args) { try { //方式1:获取当前类的ClassLoader ClassLoader classLoader = Class.forName("java.lang.String").getClassLoader(); System.out.println(classLoader);//null //方式2:获取当前线程上下文的CLassLoader(即当前类ClassLoaderTest2的加载器) ClassLoader classLoader1 = Thread.currentThread().getContextClassLoader(); System.out.println(classLoader1);//sun.misc.Launcher$AppClassLoader@18b4aac2 //方式3:获取系统的ClassLoader ClassLoader classLoader2 = ClassLoader.getSystemClassLoader().getParent(); System.out.println(classLoader2);//sun.misc.Launcher$ExtClassLoader@4554617c } catch (ClassNotFoundException e) { e.printStackTrace(); } } }

    几种类加载器的继承关系:

    #mermaid-svg-n9YB5pCnFbFvKDPC .label{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);fill:#333;color:#333}#mermaid-svg-n9YB5pCnFbFvKDPC .label text{fill:#333}#mermaid-svg-n9YB5pCnFbFvKDPC .node rect,#mermaid-svg-n9YB5pCnFbFvKDPC .node circle,#mermaid-svg-n9YB5pCnFbFvKDPC .node ellipse,#mermaid-svg-n9YB5pCnFbFvKDPC .node polygon,#mermaid-svg-n9YB5pCnFbFvKDPC .node path{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-n9YB5pCnFbFvKDPC .node .label{text-align:center;fill:#333}#mermaid-svg-n9YB5pCnFbFvKDPC .node.clickable{cursor:pointer}#mermaid-svg-n9YB5pCnFbFvKDPC .arrowheadPath{fill:#333}#mermaid-svg-n9YB5pCnFbFvKDPC .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-svg-n9YB5pCnFbFvKDPC .flowchart-link{stroke:#333;fill:none}#mermaid-svg-n9YB5pCnFbFvKDPC .edgeLabel{background-color:#e8e8e8;text-align:center}#mermaid-svg-n9YB5pCnFbFvKDPC .edgeLabel rect{opacity:0.9}#mermaid-svg-n9YB5pCnFbFvKDPC .edgeLabel span{color:#333}#mermaid-svg-n9YB5pCnFbFvKDPC .cluster rect{fill:#ffffde;stroke:#aa3;stroke-width:1px}#mermaid-svg-n9YB5pCnFbFvKDPC .cluster text{fill:#333}#mermaid-svg-n9YB5pCnFbFvKDPC div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:12px;background:#ffffde;border:1px solid #aa3;border-radius:2px;pointer-events:none;z-index:100}#mermaid-svg-n9YB5pCnFbFvKDPC .actor{stroke:#ccf;fill:#ECECFF}#mermaid-svg-n9YB5pCnFbFvKDPC text.actor>tspan{fill:#000;stroke:none}#mermaid-svg-n9YB5pCnFbFvKDPC .actor-line{stroke:grey}#mermaid-svg-n9YB5pCnFbFvKDPC .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333}#mermaid-svg-n9YB5pCnFbFvKDPC .messageLine1{stroke-width:1.5;stroke-dasharray:2, 2;stroke:#333}#mermaid-svg-n9YB5pCnFbFvKDPC #arrowhead path{fill:#333;stroke:#333}#mermaid-svg-n9YB5pCnFbFvKDPC .sequenceNumber{fill:#fff}#mermaid-svg-n9YB5pCnFbFvKDPC #sequencenumber{fill:#333}#mermaid-svg-n9YB5pCnFbFvKDPC #crosshead path{fill:#333;stroke:#333}#mermaid-svg-n9YB5pCnFbFvKDPC .messageText{fill:#333;stroke:#333}#mermaid-svg-n9YB5pCnFbFvKDPC .labelBox{stroke:#ccf;fill:#ECECFF}#mermaid-svg-n9YB5pCnFbFvKDPC .labelText,#mermaid-svg-n9YB5pCnFbFvKDPC .labelText>tspan{fill:#000;stroke:none}#mermaid-svg-n9YB5pCnFbFvKDPC .loopText,#mermaid-svg-n9YB5pCnFbFvKDPC .loopText>tspan{fill:#000;stroke:none}#mermaid-svg-n9YB5pCnFbFvKDPC .loopLine{stroke-width:2px;stroke-dasharray:2, 2;stroke:#ccf;fill:#ccf}#mermaid-svg-n9YB5pCnFbFvKDPC .note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-n9YB5pCnFbFvKDPC .noteText,#mermaid-svg-n9YB5pCnFbFvKDPC .noteText>tspan{fill:#000;stroke:none}#mermaid-svg-n9YB5pCnFbFvKDPC .activation0{fill:#f4f4f4;stroke:#666}#mermaid-svg-n9YB5pCnFbFvKDPC .activation1{fill:#f4f4f4;stroke:#666}#mermaid-svg-n9YB5pCnFbFvKDPC .activation2{fill:#f4f4f4;stroke:#666}#mermaid-svg-n9YB5pCnFbFvKDPC .mermaid-main-font{font-family:"trebuchet ms", verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-n9YB5pCnFbFvKDPC .section{stroke:none;opacity:0.2}#mermaid-svg-n9YB5pCnFbFvKDPC .section0{fill:rgba(102,102,255,0.49)}#mermaid-svg-n9YB5pCnFbFvKDPC .section2{fill:#fff400}#mermaid-svg-n9YB5pCnFbFvKDPC .section1,#mermaid-svg-n9YB5pCnFbFvKDPC .section3{fill:#fff;opacity:0.2}#mermaid-svg-n9YB5pCnFbFvKDPC .sectionTitle0{fill:#333}#mermaid-svg-n9YB5pCnFbFvKDPC .sectionTitle1{fill:#333}#mermaid-svg-n9YB5pCnFbFvKDPC .sectionTitle2{fill:#333}#mermaid-svg-n9YB5pCnFbFvKDPC .sectionTitle3{fill:#333}#mermaid-svg-n9YB5pCnFbFvKDPC .sectionTitle{text-anchor:start;font-size:11px;text-height:14px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-n9YB5pCnFbFvKDPC .grid .tick{stroke:#d3d3d3;opacity:0.8;shape-rendering:crispEdges}#mermaid-svg-n9YB5pCnFbFvKDPC .grid .tick text{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-n9YB5pCnFbFvKDPC .grid path{stroke-width:0}#mermaid-svg-n9YB5pCnFbFvKDPC .today{fill:none;stroke:red;stroke-width:2px}#mermaid-svg-n9YB5pCnFbFvKDPC .task{stroke-width:2}#mermaid-svg-n9YB5pCnFbFvKDPC .taskText{text-anchor:middle;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-n9YB5pCnFbFvKDPC .taskText:not([font-size]){font-size:11px}#mermaid-svg-n9YB5pCnFbFvKDPC .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-n9YB5pCnFbFvKDPC .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-svg-n9YB5pCnFbFvKDPC .task.clickable{cursor:pointer}#mermaid-svg-n9YB5pCnFbFvKDPC .taskText.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-n9YB5pCnFbFvKDPC .taskTextOutsideLeft.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-n9YB5pCnFbFvKDPC .taskTextOutsideRight.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-n9YB5pCnFbFvKDPC .taskText0,#mermaid-svg-n9YB5pCnFbFvKDPC .taskText1,#mermaid-svg-n9YB5pCnFbFvKDPC .taskText2,#mermaid-svg-n9YB5pCnFbFvKDPC .taskText3{fill:#fff}#mermaid-svg-n9YB5pCnFbFvKDPC .task0,#mermaid-svg-n9YB5pCnFbFvKDPC .task1,#mermaid-svg-n9YB5pCnFbFvKDPC .task2,#mermaid-svg-n9YB5pCnFbFvKDPC .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-svg-n9YB5pCnFbFvKDPC .taskTextOutside0,#mermaid-svg-n9YB5pCnFbFvKDPC .taskTextOutside2{fill:#000}#mermaid-svg-n9YB5pCnFbFvKDPC .taskTextOutside1,#mermaid-svg-n9YB5pCnFbFvKDPC .taskTextOutside3{fill:#000}#mermaid-svg-n9YB5pCnFbFvKDPC .active0,#mermaid-svg-n9YB5pCnFbFvKDPC .active1,#mermaid-svg-n9YB5pCnFbFvKDPC .active2,#mermaid-svg-n9YB5pCnFbFvKDPC .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-svg-n9YB5pCnFbFvKDPC .activeText0,#mermaid-svg-n9YB5pCnFbFvKDPC .activeText1,#mermaid-svg-n9YB5pCnFbFvKDPC .activeText2,#mermaid-svg-n9YB5pCnFbFvKDPC .activeText3{fill:#000 !important}#mermaid-svg-n9YB5pCnFbFvKDPC .done0,#mermaid-svg-n9YB5pCnFbFvKDPC .done1,#mermaid-svg-n9YB5pCnFbFvKDPC .done2,#mermaid-svg-n9YB5pCnFbFvKDPC .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-svg-n9YB5pCnFbFvKDPC .doneText0,#mermaid-svg-n9YB5pCnFbFvKDPC .doneText1,#mermaid-svg-n9YB5pCnFbFvKDPC .doneText2,#mermaid-svg-n9YB5pCnFbFvKDPC .doneText3{fill:#000 !important}#mermaid-svg-n9YB5pCnFbFvKDPC .crit0,#mermaid-svg-n9YB5pCnFbFvKDPC .crit1,#mermaid-svg-n9YB5pCnFbFvKDPC .crit2,#mermaid-svg-n9YB5pCnFbFvKDPC .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-svg-n9YB5pCnFbFvKDPC .activeCrit0,#mermaid-svg-n9YB5pCnFbFvKDPC .activeCrit1,#mermaid-svg-n9YB5pCnFbFvKDPC .activeCrit2,#mermaid-svg-n9YB5pCnFbFvKDPC .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-svg-n9YB5pCnFbFvKDPC .doneCrit0,#mermaid-svg-n9YB5pCnFbFvKDPC .doneCrit1,#mermaid-svg-n9YB5pCnFbFvKDPC .doneCrit2,#mermaid-svg-n9YB5pCnFbFvKDPC .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-svg-n9YB5pCnFbFvKDPC .milestone{transform:rotate(45deg) scale(0.8, 0.8)}#mermaid-svg-n9YB5pCnFbFvKDPC .milestoneText{font-style:italic}#mermaid-svg-n9YB5pCnFbFvKDPC .doneCritText0,#mermaid-svg-n9YB5pCnFbFvKDPC .doneCritText1,#mermaid-svg-n9YB5pCnFbFvKDPC .doneCritText2,#mermaid-svg-n9YB5pCnFbFvKDPC .doneCritText3{fill:#000 !important}#mermaid-svg-n9YB5pCnFbFvKDPC .activeCritText0,#mermaid-svg-n9YB5pCnFbFvKDPC .activeCritText1,#mermaid-svg-n9YB5pCnFbFvKDPC .activeCritText2,#mermaid-svg-n9YB5pCnFbFvKDPC .activeCritText3{fill:#000 !important}#mermaid-svg-n9YB5pCnFbFvKDPC .titleText{text-anchor:middle;font-size:18px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-n9YB5pCnFbFvKDPC g.classGroup text{fill:#9370db;stroke:none;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:10px}#mermaid-svg-n9YB5pCnFbFvKDPC g.classGroup text .title{font-weight:bolder}#mermaid-svg-n9YB5pCnFbFvKDPC g.clickable{cursor:pointer}#mermaid-svg-n9YB5pCnFbFvKDPC g.classGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-n9YB5pCnFbFvKDPC g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-n9YB5pCnFbFvKDPC .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5}#mermaid-svg-n9YB5pCnFbFvKDPC .classLabel .label{fill:#9370db;font-size:10px}#mermaid-svg-n9YB5pCnFbFvKDPC .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-n9YB5pCnFbFvKDPC .dashed-line{stroke-dasharray:3}#mermaid-svg-n9YB5pCnFbFvKDPC #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-n9YB5pCnFbFvKDPC #compositionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-n9YB5pCnFbFvKDPC #aggregationStart{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-n9YB5pCnFbFvKDPC #aggregationEnd{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-n9YB5pCnFbFvKDPC #dependencyStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-n9YB5pCnFbFvKDPC #dependencyEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-n9YB5pCnFbFvKDPC #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-n9YB5pCnFbFvKDPC #extensionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-n9YB5pCnFbFvKDPC .commit-id,#mermaid-svg-n9YB5pCnFbFvKDPC .commit-msg,#mermaid-svg-n9YB5pCnFbFvKDPC .branch-label{fill:lightgrey;color:lightgrey;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-n9YB5pCnFbFvKDPC .pieTitleText{text-anchor:middle;font-size:25px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-n9YB5pCnFbFvKDPC .slice{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-n9YB5pCnFbFvKDPC g.stateGroup text{fill:#9370db;stroke:none;font-size:10px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-n9YB5pCnFbFvKDPC g.stateGroup text{fill:#9370db;fill:#333;stroke:none;font-size:10px}#mermaid-svg-n9YB5pCnFbFvKDPC g.statediagram-cluster .cluster-label text{fill:#333}#mermaid-svg-n9YB5pCnFbFvKDPC g.stateGroup .state-title{font-weight:bolder;fill:#000}#mermaid-svg-n9YB5pCnFbFvKDPC g.stateGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-n9YB5pCnFbFvKDPC g.stateGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-n9YB5pCnFbFvKDPC .transition{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-n9YB5pCnFbFvKDPC .stateGroup .composit{fill:white;border-bottom:1px}#mermaid-svg-n9YB5pCnFbFvKDPC .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px}#mermaid-svg-n9YB5pCnFbFvKDPC .state-note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-n9YB5pCnFbFvKDPC .state-note text{fill:black;stroke:none;font-size:10px}#mermaid-svg-n9YB5pCnFbFvKDPC .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.7}#mermaid-svg-n9YB5pCnFbFvKDPC .edgeLabel text{fill:#333}#mermaid-svg-n9YB5pCnFbFvKDPC .stateLabel text{fill:#000;font-size:10px;font-weight:bold;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-n9YB5pCnFbFvKDPC .node circle.state-start{fill:black;stroke:black}#mermaid-svg-n9YB5pCnFbFvKDPC .node circle.state-end{fill:black;stroke:white;stroke-width:1.5}#mermaid-svg-n9YB5pCnFbFvKDPC #statediagram-barbEnd{fill:#9370db}#mermaid-svg-n9YB5pCnFbFvKDPC .statediagram-cluster rect{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-n9YB5pCnFbFvKDPC .statediagram-cluster rect.outer{rx:5px;ry:5px}#mermaid-svg-n9YB5pCnFbFvKDPC .statediagram-state .divider{stroke:#9370db}#mermaid-svg-n9YB5pCnFbFvKDPC .statediagram-state .title-state{rx:5px;ry:5px}#mermaid-svg-n9YB5pCnFbFvKDPC .statediagram-cluster.statediagram-cluster .inner{fill:white}#mermaid-svg-n9YB5pCnFbFvKDPC .statediagram-cluster.statediagram-cluster-alt .inner{fill:#e0e0e0}#mermaid-svg-n9YB5pCnFbFvKDPC .statediagram-cluster .inner{rx:0;ry:0}#mermaid-svg-n9YB5pCnFbFvKDPC .statediagram-state rect.basic{rx:5px;ry:5px}#mermaid-svg-n9YB5pCnFbFvKDPC .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#efefef}#mermaid-svg-n9YB5pCnFbFvKDPC .note-edge{stroke-dasharray:5}#mermaid-svg-n9YB5pCnFbFvKDPC .statediagram-note rect{fill:#fff5ad;stroke:#aa3;stroke-width:1px;rx:0;ry:0}:root{--mermaid-font-family: '"trebuchet ms", verdana, arial';--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive}#mermaid-svg-n9YB5pCnFbFvKDPC .error-icon{fill:#522}#mermaid-svg-n9YB5pCnFbFvKDPC .error-text{fill:#522;stroke:#522}#mermaid-svg-n9YB5pCnFbFvKDPC .edge-thickness-normal{stroke-width:2px}#mermaid-svg-n9YB5pCnFbFvKDPC .edge-thickness-thick{stroke-width:3.5px}#mermaid-svg-n9YB5pCnFbFvKDPC .edge-pattern-solid{stroke-dasharray:0}#mermaid-svg-n9YB5pCnFbFvKDPC .edge-pattern-dashed{stroke-dasharray:3}#mermaid-svg-n9YB5pCnFbFvKDPC .edge-pattern-dotted{stroke-dasharray:2}#mermaid-svg-n9YB5pCnFbFvKDPC .marker{fill:#333}#mermaid-svg-n9YB5pCnFbFvKDPC .marker.cross{stroke:#333} :root { --mermaid-font-family: "trebuchet ms", verdana, arial;} #mermaid-svg-n9YB5pCnFbFvKDPC { color: rgba(0, 0, 0, 0.75); font: ; } SecureClassLoader abstract ClassLoader URLClassLoader ExtClassLoader AppClassLoader
    Processed: 0.009, SQL: 8