Methods and Apparatus for Dynamic Class Reloading and Versioning
First Claim
1. A system, comprising:
- at least one processor; and
a memory storing program instructions executable by the at least one processor to implement a dynamic class reloading component configured to;
determine that a previously loaded version of a class is not current with a class definition of the class in a class file;
generate a new version of a body class for the class and a new version of a static body class for the class using bytecode from the class file, wherein the new versions of the body class and the static body class are given unique names;
generate an instance of the new version of the static body class and set a static body class field of the class to refer to the instance of the new version of the static body class;
for each existing instance of the class, generate an instance of the new version of the body class and set a body class field of the existing instance of the class to the corresponding instance of the new version of the body class; and
load a new version of the class corresponding to the class definition of the class in the class file via a class loader for the class.
2 Assignments
0 Petitions
Accused Products
Abstract
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.
-
Citations
20 Claims
-
1. A system, comprising:
-
at least one processor; and a memory storing program instructions executable by the at least one processor to implement a dynamic class reloading component configured to; determine that a previously loaded version of a class is not current with a class definition of the class in a class file; generate a new version of a body class for the class and a new version of a static body class for the class using bytecode from the class file, wherein the new versions of the body class and the static body class are given unique names; generate an instance of the new version of the static body class and set a static body class field of the class to refer to the instance of the new version of the static body class; for each existing instance of the class, generate an instance of the new version of the body class and set a body class field of the existing instance of the class to the corresponding instance of the new version of the body class; and load a new version of the class corresponding to the class definition of the class in the class file via a class loader for the class. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A computer-implemented method, comprising:
-
determining that a previously loaded version of a class is not current with a class definition of the class in a class file; generating a new version of a body class for the class and a new version of a static body class for the class using bytecode from the class file, wherein the new versions of the body class and the static body class are given unique names; generating an instance of the new version of the static body class and setting a static body class field of the class to refer to the instance of the new version of the static body class; for each existing instance of the class, generating an instance of the new version of the body class and setting a body class field of the existing instance of the class to the corresponding instance of the new version of the body class; and loading a new version of the class corresponding to the class definition of the class in the class file via a class loader for the class. - View Dependent Claims (9, 10, 11, 12, 13, 14)
-
-
15. A computer-readable storage medium storing program instructions, wherein the program instructions are computer-executable to implement:
-
determining that a previously loaded version of a class is not current with a class definition of the class in a class file; generating a new version of a body class for the class and a new version of a static body class for the class using bytecode from the class file, wherein the new versions of the body class and the static body class are given unique names; generating an instance of the new version of the static body class and setting a static body class field of the class to refer to the instance of the new version of the static body class; for each existing instance of the class, generating an instance of the new version of the body class and setting a body class field of the existing instance of the class to the corresponding instance of the new version of the body class; and loading a new version of the class corresponding to the class definition of the class in the class file via a class loader for the class. - View Dependent Claims (16, 17, 18, 19, 20)
-
Specification