Java Class Reloading via State and Behavior Segmentation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing Java Virtual Machine (JVM) technologies do not efficiently reload changed classes without re-loading unchanged classes, leading to long startup times and resource consumption during application development and testing.

Innovation Solution

A method and system that split the original class into a state class and a behavior class, with the state class simulating the original class's signature through proxying and redirecting method calls to the latest version of the behavior class using reflection, allowing for efficient reloading of changed classes without re-loading other unchanged classes.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If standard JVM reloads class loaders along with all their classes, then class reloading is supported, but all current class instances are lost and reloading time is long

Engineering Contradiction:
Improveclass reloading capabilityVSAvoidreloading time
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

The patent segments the class reloading process by introducing a state preservation mechanism that separates instance state from class definition. The state class captures the runtime state of instances before reloading, allowing the class to be reloaded without losing instance data. This segmentation enables selective reloading of only the modified class rather than the entire class loader hierarchy.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs preliminary actions by serializing and storing the state of class instances before the reload operation. The state class is created and populated with instance data in advance, so that when the class is reloaded, the state can be quickly restored without requiring full instance reconstruction. This preliminary state capture eliminates the time penalty associated with traditional reloads.

Inventive Principle:
Principle #10Preliminary action

2Adaptability or versatility

If standard JVM reloads class loaders along with all their classes, then class reloading is supported, but all current class instances are lost

Engineering Contradiction:
Improveclass reloading capabilityVSAvoidinstance state
Core Design Contradiction:
Adaptability or versatilityVSLoss of information

Solution Approach 1:

The patent creates a copy of the instance state through the state class mechanism. Before reloading, the current instance state is copied into a state class object that persists across the reload boundary. This copy allows the original instances to be reconstructed after reloading with their original state intact, preventing information loss while enabling class reloading.

Inventive Principle:
Principle #26Copying

3Productivity

If HotSwap is used to reload classes, then method bodies can be changed, but method signatures, classes and fields cannot be updated

Engineering Contradiction:
Improvedevelopment efficiencyVSAvoidclass modification capability
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The patent segments class modification into multiple independent dimensions: method bodies, method signatures, fields, and class structure. By using the state class pattern and reflective instantiation, each component can be modified independently without requiring full class reload. This segmentation enables comprehensive class adaptability while maintaining development efficiency.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces dynamic class modification capabilities through reflective instantiation and state class manipulation. Classes can be dynamically updated at runtime with new method signatures, fields, and structures without static compilation constraints. The system dynamically adapts class definitions while preserving instance state, enabling versatile class evolution during execution.

Inventive Principle:
Principle #15Dynamics

4Reliability

If all classes are re-loaded for testing, then application can be re-tested, but startup time and resource consumption increase

Engineering Contradiction:
Improvetesting accuracyVSAvoidstartup time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent applies partial action by reloading only the specific modified class rather than the entire application class set. The state class mechanism enables selective reloading of individual classes while preserving the rest of the application state. This partial reload approach maintains testing accuracy for modified components while avoiding the overhead of full application restart.

Inventive Principle:
Principle #16Partial or excessive action

5Reliability

If all classes are re-loaded for testing, then application can be re-tested, but resource consumption increases

Engineering Contradiction:
Improvetesting accuracyVSAvoidresource consumption
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The patent segments the resource-intensive class loading process into isolated units. By using state classes to preserve instance state, only the specific modified class needs to be loaded into memory, rather than the entire application. This segmentation reduces memory consumption and processing resources while maintaining testing reliability through state preservation.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS8745643B2Method and arrangement for re-loading a class
Publication Date: 2014.06.03 ZEROTURNAROUND
  • US8745643B2 patent drawing
  • US8745643B2 patent drawing
  • US8745643B2 patent drawing

AI summary

The method is for deploying an input class in a computer readable memory. A state class is created that has at least one field and at least one proxy method and a behavior class version that includes at least one method on the basis of the input class. At least one method call of the state class is redirected to the behavior class version. Also, an arrangement and a computer-software are disclosed.