Source:
getting APPClassLoader, incoming extcl, as his parents
figure above, set the thread context class loader currently executing, that is, APPClassLoader
The figure above, the security manager of some code
The application is returned class loader
In the ClassLoader
class ClassLoader
above it can be seen that, if (cls! = Null) That is, you can set their own class loader used as a system class loader.
There constructor parameters invoked by reflection custom system class loader, parameters ClassLoader
This is the reason for loading custom placed this configuration method, the method in order to make the reflection in the run method of the ClassLoader call SystemClassLoaderAction
split line------------------------------------------------ ---------------------------
analytical method forName
forName:
return of the caller is calling forName method of that class
returned ccl method is to call forName that kind of class loader
For example: a custom class, called forName (database-driven jdbc link or something)
then the caller is my custom class
ccl class loader is to load my class
Look at this