You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Mikhail Pochatkin (Jira)" <ji...@apache.org> on 2023/05/15 11:10:00 UTC

[jira] [Created] (IGNITE-19475) Implement class loaders hierarchy

Mikhail Pochatkin created IGNITE-19475:
------------------------------------------

             Summary: Implement class loaders hierarchy
                 Key: IGNITE-19475
                 URL: https://issues.apache.org/jira/browse/IGNITE-19475
             Project: Ignite
          Issue Type: New Feature
            Reporter: Mikhail Pochatkin
         Attachments: image-2023-05-15-14-09-41-734.png

h3. Class loaders hierarchy

!image-2023-05-15-14-09-41-734.png!

 

For user defined classes loading and execution are responsible class loaders. The class loaders are built in the hierarchy pictured above. 

 

The Bootstrap, the extension and the system class loaders are provided by the runtime environment and each class loader first delegates class loading logic to the parent class loader.

 

Such an approach is not suitable for all user use cases. For example it is impossible to override behavior of some classes. Apache Ignite 3 provides more flexible behavior of class loaders which could be managed by a user - Ignite chained class loader. In general, the Ignite class loader behave like web application classloader in popular web application containers (e.g. Apache Tomcat):

 
 * Ignite class loader disallows to override classes from the following packages:
 * org.java.*
 * org.javax.*
 * org.apache.ignite.*
 * org.gridgain.* (for GridGain 9 only)



If the system tries to find a class from packages listed above then the Ignite class loader should delegate this logic to the parent class loader first (in our hierarchy it is the system class loader).
 * Ignite class loader allows to override any non-system and non-Ignite class. If the system tries to find class from any package that is not listed in the previous item then Ignite class loader should try to find class over corresponding deployment unit and delegate this logic to the parent class loader in case of failure.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)