defineClass(className, byte[], offset, length)
new CustomClassLoader(Thread.currentThread().getContextClassLoader())
Thread.currentThread().setContextClassLoader()
Class.forName(String, true, the CustomClassLoader)
What did I misunderstand? If you need more information, a detailed topic is on my GitHub .
Java class loaders first look for the parent class loader before looking in it.
The loadClass method in ClassLoader performs these tasks so that when called to load the class:If the class is already loaded, it returns it.Otherwise, it delegates the search for the new class to the parent class loader.If the loader of the parent class does not find the class, loadClass calls the findClass method to find and load the class.( Understanding Extension Class Loading - Oracle)
The loadClass method in ClassLoader performs these tasks so that when called to load the class:
( Understanding Extension Class Loading - Oracle)
, loadClass, , , .
loadClass
B
, :
A
, , , , , A, A, . defineClass A, , B, , - B...
defineClass
, A. Reflection defineClass ClassLoader, B. - Java-, API- Instrumentation B .
ClassLoader
Source: https://habr.com/ru/post/1649479/More articles:ExecJS runtime error while trying to precompile assets for production in RoR - ruby-on-railsIEndpointBehavior Lifecycle Service Calls - c #Specifying various JSON property names according to API version with Jackson - javaCamera object always returns null - javaInherit a model with different JSON property names - javaGet JSON post parameter in PHP - phpФайл __init__ не работает должным образом в python - pythonSegmentation error during dynamic loading in OSX - rustHow to safely transfer initial JSON state in an isomorphic React application? - jsonProblems in Excel 2013 when using ranges beyond line 65536 - vbaAll Articles