Dynamic Class Reloading for JVM Versioning

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional Java Virtual Machine (JVM) technology lacks support for dynamically changing classes once loaded, requiring redeployment or restart of applications for even minor modifications, which is time-consuming and disruptive to the development process.

Innovation Solution

A dynamic class reloading component that allows for modifying class definitions by adding, removing fields, changing method signatures, and generating new class versions without redeploying or restarting the application, enabling dynamic loading of updated classes into a running JVM.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If conventional JVM technology is used to load classes, then the class can be loaded into memory and executed, but the class cannot be modified or reloaded without redeploying the entire application

Engineering Contradiction:
Improveclass modifiabilityVSAvoiddevelopment efficiency
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The patent implements dynamic class reloading by allowing class definitions to be modified and reloaded at runtime without application redeployment. The system maintains multiple versions of classes and enables switching between versions, transforming the static class loading mechanism into a dynamic one that supports continuous modification and updating of classes during execution.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent segments the class loading process by introducing separate version management for different classes. Each class can be independently versioned, loaded, and reloaded without affecting other classes. This segmentation allows selective updates of specific classes while maintaining the overall application structure intact.

Inventive Principle:
Principle #1Segmentation

2Adaptability or versatility

If class definitions are modified by adding or removing fields or changing method signatures, then the class functionality can be enhanced, but the VM type system cannot accommodate these structural changes

Engineering Contradiction:
Improveclass structure flexibilityVSAvoidtype system compatibility
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The patent implements dynamic class reloading by allowing class definitions to be modified and reloaded at runtime without application redeployment. The system maintains multiple versions of classes and enables switching between versions, transforming the static class loading mechanism into a dynamic one that supports continuous modification and updating of classes during execution.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent creates and maintains multiple versions of class definitions simultaneously. When a class is modified, a new version is created rather than modifying the existing one in place. This copying approach allows the type system to maintain consistency with multiple valid versions coexisting, while enabling structural changes through version substitution.

Inventive Principle:
Principle #26Copying

3Reliability

If conventional class loading is used, then the application can run stably, but any class modification requires time-consuming redeployment or restart

Engineering Contradiction:
Improveapplication stabilityVSAvoiddeployment time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent performs preliminary actions by pre-loading and validating multiple versions of class definitions before they are needed. The system prepares class versions in advance and maintains them in a ready state, so when a reload is triggered, the switching can occur quickly without time-consuming redeployment or restart operations.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces a class loader intermediary that manages the transition between class versions. This intermediary component handles the complexity of version switching, validation, and instantiation, allowing stable application execution while enabling rapid class updates without direct intervention in the running application.

Inventive Principle:
Principle #24Intermediary (Mediator)

4Device complexity

If the same class name is used for different versions, then class loading is simple, but different versions cannot coexist in the VM

Engineering Contradiction:
Improveclass loading complexityVSAvoidclass versioning capability
Core Design Contradiction:
Device complexityVSAdaptability or versatility

Solution Approach 1:

The patent adds a version dimension to class identification by incorporating version numbers or timestamps into the class definition metadata. This dimensional extension allows multiple versions of the same class to be distinguished and coexist within the VM, while maintaining simple class loading syntax for the application developer.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

Solution Approach 2:

The patent introduces a class loader intermediary that manages the transition between class versions. This intermediary component handles the complexity of version switching, validation, and instantiation, allowing stable application execution while enabling rapid class updates without direct intervention in the running application.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS8612930B2Methods and apparatus for dynamic class reloading and versioning
Publication Date: 2013.12.17 ORACLE AMERICAN INC
  • US8612930B2 patent drawing
  • US8612930B2 patent drawing
  • US8612930B2 patent drawing

AI summary

Methods and apparatus for dynamic class reloading and versioning that allow developers to change and recompile classes and to have running programs adopt the new versions of the classes dynamically, without redeploying the application. A dynamic class reloading component detects if the environment supports dynamic class redefinition and uses it if supported but does not require it. As the component loads a managed class, it modifies the bytecode of the class and generates additional classes and interfaces to support type-safe class versioning. Unique names are generated for successive versions of a managed class. A separate interface may be generated for each distinct method name and signature implemented on managed classes. Each generated class may implement all the generated interfaces that correspond to its methods. The same class loader that would load each managed class without the component loads the component-generated classes and interfaces.