Java Classloader Hierarchy for Selective Module Reloading
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current Java application deployment systems require reloading all classes when a single module or Enterprise Java Bean (EJB) is updated, leading to inefficient reinitialization of the entire application and lack of namespace separation between modules.
Innovation Solution
Reorganizing the root and webapp classloader levels to allow individual EJB implementation classes to be loaded in their own classloader, enabling selective reloading of modules without affecting the rest of the application, and allowing developers to customize the classloader hierarchy through deployment descriptors.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If all classes are reloaded when a single module or EJB is updated, then namespace separation between modules is achieved, but application reinitialization time and resource consumption increase significantly
Solution Approach 1:
The patent segments the classloader hierarchy into multiple levels: root classloader for shared classes, module classloaders for individual modules, and EJB classloaders for specific Enterprise Java Beans. This segmentation allows selective reloading of only the modified module or EJB classloader and its child classloaders, rather than forcing a complete application reinitialization. The hierarchical structure maintains namespace separation while enabling granular control over class reloading.
2Device complexity
If a flat classloader structure is used, then system complexity is reduced, but individual module reloading capability is lost
Solution Approach 1:
The patent implements a nested classloader hierarchy where child classloaders are embedded within parent classloaders. The root classloader contains module classloaders, which in turn contain EJB classloaders. This nesting structure allows the system to maintain a manageable hierarchical complexity while providing fine-grained control over module reloading. Each nested level can be independently reloaded without affecting other levels, enabling individual module updates while preserving overall system stability.
3Stability of the object's composition
If the entire application is reinitialized upon module update, then consistency across all modules is maintained, but productivity and deployment efficiency decrease
Solution Approach 1:
The patent applies local quality by allowing different parts of the classloader hierarchy to have different reloading behaviors. When a module is updated, only the specific module classloader and its child classloaders are reinitialized, while other module classloaders remain intact. This localized reloading approach maintains consistency within the updated module while preserving stability in other parts of the application, thereby improving deployment efficiency without sacrificing overall system consistency.
Data Source
AI summary
A system and method for allowing individual software modules to be reloaded in memory without forcing other modules to be reloaded at the same time. Such reloadable modules address the problem of not being able to reload a module without reloading all classes in the application. In accordance with one embodiment the root classloader and webapp classloader are reorganized, and the individual modules placed in their own classloader. This allows the developer to define their classloader organization according to their needs. The system can then reload modules or classes without affecting the rest of the application.


