1. In-depth analysis of class loaders and delegation mechanismsThe role of the > ClassLoader: A class that appears in a Java file, first to load the class's bytecode into memory, and this class of information is placed in a class file under the classpath of the hard disk,Loading the contents of the
JDK default 3 kinds of loaders: the parent class loader for all ClassLoader bootstrap ClassLoader, which is part of the JVM, is written in C + +, and it loads java_home/jre/ Class libraries in the Lib directory, such as: Rt.jar into memory. Extension ClassLoader is a subclass of bo
Some thoughts on App Class Loader"This article's main reference article Appclassloader's author is the famous Java Vision boss Robbin"
I have not seen the Java depth adventure, but also how many have heard about class loader discussion, read Robbin wrote the app Class
After Reading Wang Sen's Java deep adventure, he made a simple study note.
1. the Java class loader loads classes on demand only when a class is to be used (a class is instantiated using the new keyword, the Class Loader loads the
disk. But to run the program, you must first load the. class file into the JVM's memory for use, and the ClassLoader is responsible for loading the. class file on the disk into the JVM memory, as shown in:You can assume that each class object has the. Class bytecode content on the disk, and each
The ClassLoader is used to load the. class file into the virtual machine and generate the Java.lang.Class object.Class loader structureThe class loaders that the JVM comes with are:Bootstrap Loaderboot loader aka root loader, is the NU WA level
. But to run the program, you must first load the. class file into the JVM's memory for use, and the ClassLoader is responsible for loading the. class file on the disk into the JVM memory, as shown in:You can assume that each class object has the. Class bytecode content on the disk, and each
Welcome to other blogs on this topic:
Deep Dive into Java Virtual Machine (I)-detailed explanation of the underlying structure of Java Virtual Machine
Deep Dive into Java Virtual Machine (II)-class lifecycle (I) class loading and Connection
In-depth Java Virtual Machine (III)-class lifecycle (ii) class initialization
library will interrupt the application server or other applications on the server. If developers do not have control over the application server, this solution is not feasible at all.
Sharing and class sharing The crux of this problem is that most J2EE vendors have designed a class loading hierarchy for their products. This hierarchy will eventually load the class
Jvm classLoader architecture:
Bootstrap ClassLoader/start class loaderIt is mainly responsible for packaging the core api under the jdk_home/lib directory or the jar specified by the-Xbootclasspath option.Extension ClassLoader/Extension class loaderIt is mainly responsible for packaging the jar package in the jdk_home/lib/ext directory or the jar package in the
ClassLoader. The DefineClass method is then used to load the class from a binary stream. However, this is not feasible in Android,Two Android class loadersAndroid class loader mainly has two pathclassloader and Dexclassloader, where Pathclassloader is the default class
bottom-up, and the custom ClassLoader to bootstrap ClassLoader-by-layer check, as long as a certain classloader is loaded as if the class has been loaded. Ensure that only all classloader of this class are loaded once. The order of loading is top-down, that is, the upper layer tries to load the class one at a level.Me
Java provides a number of service provider interfaces (services Provider INTERFACE,SPI) that allow third parties to provide implementations for these interfaces. The common SPI is JDBC, JCE, JNDI, JAXP, and JBI.These SPI interfaces are provided by the Java Core Library, and the implementation code for these SPI is included in the Classpath (CLASSPATH) as the jar package that the Java application relies on. The code in the SPI interface often needs to load specific implementation classes. So the
JAVA Class Loader section 14thToday we will load the first phase of the class loading mechanism in 5 stages, also called loading . In order to read the good distinction, the following is called loading.The first step in loading is to get a binary byte stream, which can be obtained from a read. class file, or it can rec
Article Title: classloader and package mechanism of Java
Author: asklxf
Last Updated: 17:25:20
How many clicks: 32 "href =" http://www.j2medev.com/Article_Show.asp? ArticleID = 99 "target =" _ blank "> the classloader and package mechanisms of Java introduce the classloader delegation mechanism, which transmits the loaded task to the upper-level loader, and so on until the class
We know that Java bytecode files need to be loaded into memory by the JVM to execute, so how does this load mechanism?
Things to do during the load phase:
1. Get a binary byte stream that defines this class through the fully qualified name of a class
2. Convert the static storage structure represented by this byte stream into the run-time data structure of the method area
3, generate a Java.lang.Class objec
The ClassLoader class loader is the object that is responsible for loading classes. The ClassLoader class is an abstract class. If the binary name of the given class (that is, the full name of the package name plus the name of the Class
The Java default class loader is used in a typical scenario, but sometimes you have to implement your own ClassLoader for some purpose, for example, to achieve the isolation of class libraries, for example, in order to achieve the hot-deploy reload feature. You need to define the class
method is from top down, and this class * is equivalent to a local variable of course it must be declared first, then use the *
New Inner3 (). print (); }
}
The basic responsibility of the class loader Java.lang.ClassLoader Java.lang.ClassLoader class is to find or generate its corresponding byte code
http://blog.csdn.net/com360/article/details/14125683Java, there is a concept called "ClassLoader" (ClassLoader), it is the role of dynamic loading class files. There is a ClassLoader class in the standard Java SDK that allows you to load the desired class file, and each ClassLoader object must have a path to the class
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.