Systems, processes and computer program products for communicating among different programming languages that are hosted on a Java Virtual Machine (JVM)
Saved in:
| Title: | Systems, processes and computer program products for communicating among different programming languages that are hosted on a Java Virtual Machine (JVM) |
|---|---|
| Patent Number: | 9,158,512 |
| Publication Date: | October 13, 2015 |
| Appl. No: | 13/791793 |
| Application Filed: | March 08, 2013 |
| Abstract: | An exchange provides communication among programs that run on a Java Virtual Machine (JVM) and that are written in different programming languages that are hosted on the JVM. The exchange intercepts an external call from a first program that runs on the JVM and is written in a first programming language. The exchange identifies a second program that runs on the JVM and is written in a second programming language, to which the external call from the first program may be directed. The exchange directs the external call to the second program and receives a response to the external call from the second program. The response to the external call that is received from the second program is then forwarded back to the first program. Related systems, processes and computer program products are described. |
| Inventors: | CA, Inc. (Islandia, NY, US) |
| Assignees: | CA, Inc. (New York, NY, US) |
| Claim: | 1. A computer program product comprising: a non-transitory computer readable storage medium comprising computer readable program code embodied in the medium that when executed by at least one processor causes the at least one processor to perform operations for communicating among programs that run on a Java Virtual Machine (JVM) and that are written in a plurality of different programming languages that are hosted on the JVM, wherein the JVM comprises a first compiler/interpreter associated with a first programming language of the plurality of different programming languages that are hosted on the JVM, a first program that runs on the JVM and is written in the first programming language, a second compiler/interpreter associated with a second programming language of the plurality of different programming languages that are hosted on the JVM, and a second program that runs on the JVM and is written in the second programming language, wherein the operations run on the JVM, the operations comprising the following operations that are performed by an exchange module that is communicatively coupled to the first and second programs: identifying methods that are used by the plurality of different programming languages that are hosted on the JVM, receiving, by the exchange module via the first compiler/interpreter, an exception comprising an external call from the first program, the exception indicating that a method associated with the external call cannot be processed by the first program; in response to the receiving the exception, intercepting the external call from the first program; determining that the external call may be directed to a method of the second program; formatting the external call for processing by the method of the second program; directing the external call to the second program; receiving a response to the external call from the second program; and formatting the response for processing by the first program; and forwarding the response to the external call that is received from the second program, back to the first program. |
| Claim: | 2. A computer program product according to claim 1 , wherein the receiving the exception comprising the external call from the first program the exception from the first program, the exception indicating that the method cannot be processed by the first program. |
| Claim: | 3. A computer program product according to claim 2 , wherein the intercepting the exception from the first program comprises intercepting a JRuby “method missing” message from the first program. |
| Claim: | 4. A computer program product according to claim 1 , wherein the identifying methods that are used by the plurality of different programming languages that are hosted on the JVM comprises: maintaining a registry of methods executing on the JVM, wherein a plurality of methods from the first language are registered by the first compiler/interpreter and a plurality of methods from the second language are registered by the second compiler/interpreter. |
| Claim: | 5. A computer program product according to claim 1 , wherein the exchange module is embodied by metaprogramming that runs on one of the plurality of different programming languages that are hosted on the JVM. |
| Claim: | 6. A computer program product according to claim 1 , wherein the exchange module is a first exchange module and wherein the operations further comprise: receiving, by a second exchange module that runs on the JVM, a call from the first exchange module comprising a second external call from the first program; determining that the second external call may be directed to a third program that runs on the JVM and is written in a third of the plurality of programming languages that is hosted on the JVM by a third compiler/interpreter that runs on the JVM and is communicatively coupled to the second exchange module; directing the second external call to the third program; receiving a response to the second external call from the third program; and forwarding the response to the second external call that is received from the third program, back to the first program. |
| Claim: | 7. A computer system comprising an exchange module for communicating among programs that run on a Java Virtual Machine (JVM) and that are written in a plurality of different programming languages that are hosted on the JVM, wherein the JVM comprises a first compiler/interpreter associated with a first programming language of the plurality of different programming languages that are hosted on the JVM, a first program that runs on the JVM and is written in the first programming language, a second compiler/interpreter associated with a second programming language of the plurality of different programming languages that are hosted on the JVM, and a second program that runs on the JVM and is written in the second programming language, wherein the exchange module runs on the JVM, is communicatively coupled to the first and second programs, and causes the JVM to perform operations comprising: identifying methods that are used by the plurality of different programming languages that are hosted on the JVM, receiving, via the first compiler/interpreter, an exception comprising an external call from the first program, the exception indicating that a method associated with the external call cannot be processed by the first program; in response to the receiving the exception, intercepting the external call from the first program; determining that the external call may be directed to a method of the second program; formatting the external call for processing by the method of the second program; directing the external call to the second program; receiving a response to the external call from the second program; and formatting the response for processing by the first program; and forwarding the response to the external call that is received from the second program, back to the first program. |
| Claim: | 8. A system according to claim 7 , wherein the receiving the exception comprising the external call from the first program comprises intercepting the exception from the first program, the exception indicating that the method cannot be processed by the first program. |
| Claim: | 9. A system according to claim 8 , wherein the intercepting the exception from the first program comprises intercepting a JRuby “method missing” message from the first program. |
| Claim: | 10. A system according to claim 7 , wherein the identifying methods that are used by the plurality of different programming languages that are hosted on the JVM comprises: maintaining a registry of methods executing on the JVM, wherein a plurality of methods from the first language are registered by the first compiler/interpreter and a plurality of methods from the second language are registered by the second compiler/interpreter. |
| Claim: | 11. A system according to claim 7 , wherein the exchange module is embodied by metaprogramming that runs on one of the plurality of different programming languages that are hosted on the JVM. |
| Claim: | 12. A system according to claim 7 , wherein the exchange module is a first instance of the exchange module, the system further comprising a second instance of the exchange module that runs on the JVM that causes the JVM to perform operations comprising: receiving a call from the first instance of the exchange module comprising a second external call from the first program; determining that the second external call may be directed to a third program that runs on the JVM and is written in a third of the plurality of programming languages that is hosted on the JVM by a third compiler/interpreter that runs on the JVM am dos communicatively coupled to the second instance of the exchange module; directing the second external call to the third program; receiving a response to the second external call from the third program; and forwarding the response to the second external call that is received from the third program, back to the first instance of the exchange module. |
| Claim: | 13. A system according to claim 7 , in combination with the JVM, the first compiler/interpreter associated with the first programming language of the plurality of different programming languages that are hosted on the JVM, and the second compiler/interpreter associated with the second programming language of the plurality of different programming languages that are hosted on the JVM. |
| Claim: | 14. A process for communicating among programs that run on a Java Virtual Machine (JVM) and that are written in a plurality of different programming languages that are hosted on the JVM, wherein the JVM comprises a first compiler/interpreter associated with a first programming language of the plurality of different programming languages that are hosted on the JVM, a first program that runs on the JVM and is written in the first programming language, a second compiler/interpreter associated with a second programming language of the plurality of different programming languages that are hosted on the JVM, and a second program that runs on the JVM and is written in the second programming language, the process comprising the following operations that are performed on the JVM by an exchange module that is communicatively coupled to the first and second programs: identifying methods that are used by the plurality of different programming languages that are hosted on the JVM, receiving, by the exchange module via the first compiler/interpreter, an exception comprising an external call from the first program, the exception indicating that a method associated with the external call cannot be processed by the first program; in response to the receiving the exception, intercepting the external call from the first program; determining that the external call may be directed to a method of the second program; formatting the external call for processing by the method of the second program; directing the external call to the second program; receiving a response to the external call from the second program; formatting the external call for processing by a method of the second program; forwarding the response to the external call that is received from the second program, back to the first program. |
| Claim: | 15. A process according to claim 14 , wherein the receiving the exception from the first program comprises intercepting a JRuby “method missing” message from the first program. |
| Patent References Cited: | 6192418 February 2001 Hale et al. 6820266 November 2004 Minakawa et al. 2004/0172620 September 2004 Perez 2005/0155027 July 2005 Wei 2009/0204953 August 2009 Swingler et al. 2011/0167403 July 2011 French et al. |
| Other References: | Dr. Dobb's, “A Long Look at JVM Languages”, http://www.drdobbs.com/jvm/a-long-look-at-jvm-languages/240007765, Nov. 19, 2012, accessed Jan. 10, 2013, 3 pages. cited by applicant “0.1 Being Meta, Programming Programming”, http://rubymonk.com/learning/books/2/chapters/32-introduction-to-metaprogramming/lessons/75-being-meta, accessed Jan. 14, 2013, 3 pages. cited by applicant Technical Pickles, “Using method—missing and respond—to? to create dynamic methods”, http://technicalpickles.com/posts/using-method—missing-and-respond—to-to-create-dynamic-methods/, accessed Jan. 14, 2013, 5 pages. cited by applicant “Metaprogramming in Ruby, 1.2 Calling a method”, http://ruby-metaprogramming.rubylearning.com/html/ruby—metaprogramming—2.html, accessed Jan. 14, 2013, 6 pages. cited by applicant Jonathan Bartlett, “The art of metaprogramming, Part 1: Introduction to metaprogramming”, Oct. 20, 2005, http://www.ibm.com/developerworks/linux/library/I-metaprog1/index.html, accessed Jan. 14, 2013. cited by applicant The Real Adam, “Why metaprogram when you can program?”, http://therealadam.com/2011/12/09/why-metaprogram-when-you-can-program/, accessed Jan. 14, 2013, 8 pages. cited by applicant Java virtual machine, http://en.wikipedia.org/w/index.php?oldid=532225723, accessed Jan. 10, 2013. cited by applicant |
| Assistant Examiner: | Dascomb, Jacob |
| Primary Examiner: | Bullock, Jr., Lewis A |
| Attorney, Agent or Firm: | Myers Bigel Sibley & Sajovec, P.A. |
| Accession Number: | edspgr.09158512 |
| Database: | USPTO Patent Grants |
| Abstract: | An exchange provides communication among programs that run on a Java Virtual Machine (JVM) and that are written in different programming languages that are hosted on the JVM. The exchange intercepts an external call from a first program that runs on the JVM and is written in a first programming language. The exchange identifies a second program that runs on the JVM and is written in a second programming language, to which the external call from the first program may be directed. The exchange directs the external call to the second program and receives a response to the external call from the second program. The response to the external call that is received from the second program is then forwarded back to the first program. Related systems, processes and computer program products are described. |
|---|