IP Library Granted Patent US 7,784,043
Granted Patent B2
US 7,784,043 · App. 11/224,853 · Granted Aug 24, 2010

Method and system for automated code-source indexing in Java Virtual Machine environment

Assignee: Oracle International Corporation
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,784,043
App. No.
11/224,853
Granted
Aug 24, 2010
Kind
B2
Abstract

A method and system for class loading in a Java Virtual Machine (JVM) environment. Specifically, the system includes a code-source index and a mapper. The code-source index is associated with at least one class loader in a class loader tree in the JVM environment. The code-source index includes a plurality of parameters for cross-referencing packages in the at least one class loader to code-sources. The system also includes a mapper for referencing the code-source index. That is, the mapper maps a package associated with a class to one or more associated code-sources that potentially can access the class in the class loader tree.

Claims (49)

1. A method for locating a class in a virtual machine environment, comprising:

determining with a computer system executing the virtual machine environment a package associated with a class name of said class to obtain available code sources associated with said package from a code-source index that relates code-sources to packages for a plurality of class loaders in a class loader tree in said virtual machine environment, wherein said code-source index comprises a first parameter comprising a plurality of class loaders associated with a class loader tree, a second parameter comprising a plurality of packages associated with a plurality of classes that are capable of being loaded by said plurality of class loaders, wherein each of said plurality of packages comprises at least one code-source for accessing said plurality of classes, a third parameter comprising a plurality of code-sources, wherein each of said plurality of code-sources is contained within one of said plurality of packages, and a mapper for mapping a package associated with a class to one or more associated code-sources that potentially can access said class in said plurality of class loaders;

determining with the computer system a set of code-sources from said available code-sources that are able to access said class; and

determining with the computer system a plurality of class loaders associated with said subset of code-sources and based on the class loader tree.

2. The method of claim 1 , wherein said set of code-sources is a null set.

3. The method of claim 1 , further comprising:

detecting with the computer system a change in said class loader tree; and modifying said code-source index to reflect said change.

4. The method of claim 3 , further comprising:

persisting with the computer system said code-source index to deter re-computing said code-source index; and

validating with the computer system said code-source index before using a code- source index that has been persisted.

5. The method of claim 3 , further comprising:

determining with the computer system if a code-source is visible to any given class loader in said class loader tree.

6. The method of claim 3 , further comprising:

automatically creating with the computer system said code-source index at build time.

7. A computer system comprising:

a processor;

a bus coupled to said processor; and

a computer readable medium coupled to said bus containing program instructions that when implemented cause said processor to implement a method for locating a class in a virtual machine environment, comprising:

determining a package associated with a class name of said class;

determining a set of code-sources associated with said package in said virtual machine environment from a code-source index that relates code-sources to packages for a plurality of class loaders in a class loader tree in said virtual machine environment, wherein said code-source index comprises a first parameter comprising a plurality of class loaders associated with a class loader tree, a second parameter comprising a plurality of packages associated with a plurality of classes that are capable of being loaded by said plurality of class loaders, wherein each of said plurality of packages comprises at least one code-source for accessing said plurality of classes, a third parameter comprising a plurality of code-sources, wherein each of said plurality of code-sources is contained within one of said plurality of packages, and a mapper for mapping a package associated with a class to one or more associated code-sources that potentially can access said class in said plurality of class loaders;

determining a subset of code-sources in said set of code-sources that are able to access said class; and

determining a plurality of class loaders associated with said subset of code-sources and based on the class loader tree.

8. The computer system of claim 7 , wherein said subset of code-sources is a null set.

9. The computer system of claim 7 , wherein said method further comprises:

detecting a change in said class loader tree; and

modifying said code-source index to reflect said change.

10. The computer system of claim 7 , wherein said method further comprises:

persisting said code-source index to deter re-computing said code-source index; and

validating said code-source index before using a code-source index that has been persisted.

11. The computer system of claim 7 , wherein said method further comprises:

determining if a class loader associated with a code-source able to access said class is visible to an initiating class loader that invokes a class loading event for said class in a search sequence of said initiating class loader.

12. The computer system of claim 7 , wherein said method further comprises:

automatically creating said code-source index at build time.

13. A computer readable medium containing program instructions that implement a method for locating a class in a virtual machine environment, comprising:

determining a package associated with a class name of said class;

determining a set of code-sources associated with said package in said virtual machine environment from a code-source index that relates packages to code-sources for a plurality of class loaders in a class loader tree in said virtual machine environment, wherein said code-source index comprises a first parameter comprising a plurality of class loaders associated with a class loader tree, a second parameter comprising a plurality of packages associated with a plurality of classes that are capable of being loaded by said plurality of class loaders, wherein each of said plurality of packages comprises at least one code-source for accessing said plurality of classes, a third parameter comprising a plurality of code-sources, wherein each of said plurality of code-sources is contained within one of said plurality of packages, and a mapper for mapping a package associated with a class to one or more associated code-sources that potentially can access said class in said plurality of class loaders;

determining a subset of code-sources in said set of code-sources that are able to access said class; and

determining a plurality of class loaders associated with said subset of code-sources and based on the class loader tree.

14. The computer readable medium of claim 13 , wherein said subset of code-sources is a null set.

15. The computer readable medium of claim 13 , wherein said program instructions further comprises:

detecting a change in said class loader tree; and

modifying said code-source index to reflect said change.

16. The computer readable medium of claim 13 , wherein said method program instructions further comprises:

persisting said code-source index to deter re-computing said code-source index; and

validating said code-source index before using a code-source index that has been persisted.

17. The computer readable medium of claim 13 , wherein said program instructions further comprises:

determining if a class loader associated with a code-source able to access said class is visible to an initiating class loader that invokes a class loading event for said class in a search sequence of said initiating class loader.

18. The computer readable medium of claim 13 , wherein said program instructions further comprises:

automatically creating said code-source index at build time.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 12, 2005
From: ATSATT, BRYAN
To: ORACLE INTERNATIONAL CORPORATION
Reel/Frame 016994/0272 →
Continuity (1)
Related Publication 20070061795A1 · Mar 15, 2007