Inter Java virtual machine (JVM) resource locking mechanism
Uložené v:
| Názov: | Inter Java virtual machine (JVM) resource locking mechanism |
|---|---|
| Patent Number: | 7,131,120 |
| Dátum vydania: | October 31, 2006 |
| Appl. No: | 10/150181 |
| Application Filed: | May 16, 2002 |
| Abstrakt: | A system and method of sharing a resource includes receiving a request for a shared resource in a locking repository. The request is from a requestor and the requestor is one of several applications. Each of the applications is running on one of several Java virtual machines (JVMs). The shared resource is locked to the requester, if the shared resource is identified as available in the master locking repository. |
| Inventors: | Veselov, Pavel S. (Santa Clara, CA, US) |
| Assignees: | Sun Microsystems, Inc. (Santa Clara, CA, US) |
| Claim: | 1. A method of sharing a resource comprising: providing a plurality of Java Virtual Machines (JVMs) operating in a distributed network, each of the JVMs being capable of executing one or more of a plurality of applications; receiving a request for a shared resource from a requestor, the requestor being one of the plurality of applications being executed by one of the plurality of JVMs, the request being forwarded over the distributed network to a master locking repository, the plurality of JVMs being remote from the shared resource and the plurality of JVMs operating on a one or more computing platforms, such that each of the plurality of JVMs are remote from the master locking repository; determining if the shared resource is identified as available in the master locking repository; and locking the shared resource to the requestor, if the shared resource is identified as available in the master locking repository. |
| Claim: | 2. The method of claim 1 , wherein the request identifies the requestor and identifies the shared resource being requested. |
| Claim: | 3. The method of claim 2 , wherein identifying the shared resource being requested includes identifying a category of shared resources wherein the category of shared resources includes a plurality of shared resources. |
| Claim: | 4. The method of claim 3 , wherein locking the shared resource to the requestor, if the shared resource is available includes locking the plurality of shared resources to the requestor if each one of the plurality of shared resources is available. |
| Claim: | 5. The method of claim 1 , wherein the request includes a time stamp. |
| Claim: | 6. The method of claim 1 , wherein if the shared resource is not available, then: waiting until shared resource is available; and locking the shared resource to the requestor when the shared resource becomes available. |
| Claim: | 7. The method of claim 6 , wherein the shared resource is locked to a selected requestor of a plurality of requestors, the selected requestor having a higher priority than the remaining requestors in the plurality of requestors. |
| Claim: | 8. The method of claim 1 , further comprising: providing a library included in one of the plurality of applications, the library including a slave locking repository, the slave locking repository being a substantial duplicate of the master locking repository; wherein determining if the shared resource is identified as available in the master locking repository includes: determining if the master locking repository is available; locking the shared resource to the requestor, if the master locking repository is available and identifies that the shared resource is available; and designating the slave locking repository as a new master locking repository if the if the master locking repository is not available and locking the shared resource to the requestor, if the new master locking repository identifies that the shared resource is available. |
| Claim: | 9. The method of claim 1 , further comprising: receiving an unlock request from an unlock requestor, the unlock requestor being one of the plurality of applications being executed by one of the plurality of JVMs, the unlock request being forwarded over the distributed network to the master locking repository, the unlock requestor being remote from the shared resource, the unlock request includes a request to unlock the shared resource that was previously locked to the lock requestor; determining if the unlock requestor is the same as the lock requestor; and unlocking the shared resource if the unlock requestor is the same as the lock requestor. |
| Claim: | 10. A method of unlocking a shared resource comprising: providing a plurality of Java Virtual Machines (JVMs) operating in a distributed network, each of the JVMs being capable of executing one or more of a plurality of applications; receiving an unlock request from an unlock requestor, the unlock requestor being one of the plurality of applications being executed by one of the plurality of JVMs, the unlock request being forwarded over the distributed network to a master locking repository, the unlock requestor being remote from the shared resource and the master locking repository, the unlock request includes a request to unlock a shared resource that was previously locked to a lock requestor, the lock requestor being remote from the shared resource; determining if the unlock requestor is the same as the lock requestor; and unlocking the shared resource if the unlock requestor is the same as the lock requestor. |
| Claim: | 11. A method for a requestor application to select a shared resource comprising: providing a plurality of Java Virtual Machines (JVMs) operating in a distributed network, each of the JVMs being capable of executing one or more of a plurality of applications; determining a current status of a first shared resource in a locking repository, the first shared resource being remote from the locking repository; and locking the first shared resource to a requestor application if the first shared resource is identified as available in the locking repository, the requestor being remote from the shared resource, the requestor being in communication with the shared resource by the distributed network, the requestor being one of the plurality of applications being executed by one of the plurality of JVMs. |
| Claim: | 12. The method of claim 11 , wherein determining the current status of the first shared resource includes: sending a status query to the locking repository through the distributed network; and receiving a status response from the locking repository through the distributed network. |
| Claim: | 13. The method of claim 11 , further comprising: determining a current status of a second shared resource if the first shared resource is unavailable; and locking the second shared resource to the requestor application if the second shared resource is available. |
| Claim: | 14. The method of claim 11 , wherein locking the first shared resource includes: sending a request for the first shared resource through the distributed network to the locking repository; determining if the first shared resource is available; and locking the first shared resource to the requestor in the locking repository. |
| Claim: | 15. A method of selecting a master locking repository comprising: providing a plurality of Java Virtual Machines (JVMs) operating in a distributed network, each of the JVMs being capable of executing one or more of a plurality of applications; instantiating a first application of the plurality of applications, the first application including a first library; sending a query for a master locking repository from the first library to a second library through the distributed network, if a second library has been instantiated in a second application, wherein a source of the query is remote from the first application; instantiating a master locking repository in the first library, if the second library does not respond to the query; and instantiating a slave locking repository in the first library, if the second library responds to the query. |
| Claim: | 16. The method of claim 15 , wherein the second library responds to the first query if the first library and the second library are the same type. |
| Claim: | 17. The method of claim 15 , further comprising: instantiating the plurality of applications, each one of the plurality of applications including a corresponding one of a plurality of libraries; sending a query through the distributed network for the master locking repository from each one of the plurality of libraries to the master locking repository; instantiating a corresponding plurality of slave locking repositories in each one of the plurality of libraries when the master locking repository responds to the query from each corresponding one of the plurality of libraries. |
| Claim: | 18. The method of claim 17 , further comprising: detecting a shutdown of the first application through the distributed network; selecting one of the plurality of slave locking repositories as a new master locking repository; transferring data in the master locking repository to the selected slave locking repository; determining if the data transfer was successful; designating the selected slave locking repository as the master locking repository, if the data transfer was successful. |
| Claim: | 19. The method of claim 18 , wherein if the data transfer was unsuccessful, then: selecting one of the plurality of slave locking repositories as a new master locking repository. |
| Claim: | 20. A system comprising: a plurality of shared resources remotely coupled to a first computing platform by a distributed network; the first computing platform including: a first Java virtual machine (JVM) including a first application, the first application includes a first library object; and a second JVM including a second application, the second application includes a second library object; logic for receiving a request, the request being forwarded over the distributed network for a selected one of the plurality of shared resources in a master locking repository, the request being from the first application, the first application being remote from the shared resource; logic for determining if the shared resource is identified as available in the master locking repository; and logic for locking the shared resource to the requestor in the master locking repository, if the selected shared resource is identified as available in the master locking repository. |
| Claim: | 21. The system of claim 20 , wherein the first library object includes the master locking repository if the first application was instantiated before the second application and wherein the second library includes a slave locking repository. |
| Claim: | 22. The system of claim 20 , wherein the second library object includes the master locking repository if the second application was instantiated before the first application and wherein the first library includes a slave locking repository. |
| Current U.S. Class: | 717/164 |
| Patent References Cited: | |
| Other References: | Cepeda et al., “Designing Java Applications for Network Computers”, www.redbooks.IBM.com, pp. i-xiv, 1-158, 1998. cited by examiner Lomet, “Private Lock Management”, Digital Equipment Inc., pp. i,ii, 1-26, Nov. 1992. cited by examiner Summers et al, “RM: A Resource-Sharing System For Personal Computers”, ACM, pp. 91-98, 1983. cited by examiner Thornton, “Optimistic Locking with Concurrency in Oracle”, www.orafaq.com/papers, pp. 1-9, Feb. 2001. cited by examiner |
| Primary Examiner: | Vo, Ted T. |
| Attorney, Agent or Firm: | Martine Penilla & Gencarella, LLP |
| Prístupové číslo: | edspgr.07131120 |
| Databáza: | USPTO Patent Grants |
| Abstrakt: | A system and method of sharing a resource includes receiving a request for a shared resource in a locking repository. The request is from a requestor and the requestor is one of several applications. Each of the applications is running on one of several Java virtual machines (JVMs). The shared resource is locked to the requester, if the shared resource is identified as available in the master locking repository. |
|---|