主权项 |
1. A method comprising:
executing, via at least one of one or more computing devices, a Java application in a Java virtual machine, the Java application stored in a Java distribution file, and wherein executing the Java application includes:
building, via at least one of the one or more computing devices, a class loader dependency graph describing a plurality of classes used by the Java application;conducting, via at least one of the one or more computing devices, a first traversal of the class loader dependency graph, and for individual ones of the plurality of classes during the first traversal of the class loader dependency graph:
finding, via at least one of the one or more computing devices, at least one non-shareable static field within a respective class of the plurality of classes;creating, via at least one of the one or more computing devices, mapping data associated with the Java application, the mapping data comprising a respective mapped field corresponding to the at least one non-shareable static field, the mapping data being stored in a hash table, and the mapping data being created to be accessible by an identifier associated with a deployment containing the Java application; andgenerating, via at least one of the one or more computing devices, an initializer associated with the at least one non-shareable static field when the mapping data is created; andconducting, via at least one of the one or more computing devices, a second traversal of the class loader dependency graph, and during the second traversal;
translating, via at least one of the one or more computing devices, an access to the at least one non-shareable static field within the at least one of the plurality of classes into a translated access to the mapping data associated with the at least one non-shareable static field. |